]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/32021 (Fix,document,remove GFORTRAN_* environment variables)
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 18 Oct 2007 21:25:21 +0000 (21:25 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 18 Oct 2007 21:25:21 +0000 (21:25 +0000)
PR libfortran/32021
* runtime/backtrace.c (local_strcasestr): Protect by appropriate
macros.
* runtime/main.c (cleanup): Cast argument to free.
* intrinsics/spread_generic.c (spread_internal): Match runtime_error
arguments and format.
* intrinsics/signal.c (alarm_sub_int_i4, alarm_sub_int_i8): Cast
pointers to avoid warnings.

From-SVN: r129463

libgfortran/ChangeLog
libgfortran/intrinsics/signal.c
libgfortran/intrinsics/spread_generic.c
libgfortran/runtime/backtrace.c
libgfortran/runtime/main.c

index a75c91db08fec9b43f6053b3e5a9b086c0bd97fb..6dcc055c7dbbb4d47bec0f220eda1be65a4c4cce 100644 (file)
@@ -1,3 +1,14 @@
+2007-10-18  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/32021
+       * runtime/backtrace.c (local_strcasestr): Protect by appropriate
+       macros.
+       * runtime/main.c (cleanup): Cast argument to free.
+       * intrinsics/spread_generic.c (spread_internal): Match runtime_error
+       arguments and format.
+       * intrinsics/signal.c (alarm_sub_int_i4, alarm_sub_int_i8): Cast
+       pointers to avoid warnings.
+
 2007-10-18  Ben Elliston  <bje@au.ibm.com>
 
        * runtime/environ.c (init_choice): Remove unused function.
index 2e28b543763a88acf60fa513da7bd212f151e490..84565e8e4977b6f72f0002f864e8a6077b84b752 100644 (file)
@@ -198,14 +198,14 @@ alarm_sub_int_i4 (int *seconds, int *handler, GFC_INTEGER_4 *status)
 #if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL)
   if (status != NULL)
     {
-      if (signal (SIGALRM, (void (*)(int)) *handler) == SIG_ERR)
+      if (signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler) == SIG_ERR)
        *status = -1;
       else
        *status = alarm (*seconds);
     }
   else
     {
-      signal (SIGALRM, (void (*)(int)) *handler);
+      signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler);
       alarm (*seconds);
     }
 #else
@@ -226,14 +226,14 @@ alarm_sub_int_i8 (int *seconds, int *handler, GFC_INTEGER_8 *status)
 #if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL)
   if (status != NULL)
     {
-      if (signal (SIGALRM, (void (*)(int)) *handler) == SIG_ERR)
+      if (signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler) == SIG_ERR)
        *status = -1;
       else
        *status = alarm (*seconds);
     }
   else
     {
-      signal (SIGALRM, (void (*)(int)) *handler);
+      signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler);
       alarm (*seconds);
     }
 #else
index 3752717aa8e35d840dbf9c7c05826d1f38882ad7..4be0a164c8ac3d6ea0e4667fe599c3dc62dbd825 100644 (file)
@@ -131,9 +131,9 @@ spread_internal (gfc_array_char *ret, const gfc_array_char *source,
 
                  if (ret_extent != ncopies)
                    runtime_error("Incorrect extent in return value of SPREAD"
-                                 " intrinsic in dimension %d: is %ld,"
-                                 " should be %ld", n+1, (long int) ret_extent,
-                                 (long int) ncopies);
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent, (long int) ncopies);
                }
              else
                {
@@ -142,8 +142,9 @@ spread_internal (gfc_array_char *ret, const gfc_array_char *source,
                    - source->dim[dim].lbound;
                  if (ret_extent != extent[dim])
                    runtime_error("Incorrect extent in return value of SPREAD"
-                                 " intrinsic in dimension %d: is %ld,"
-                                 " should be %ld", n+1, (long int) ret_extent,
+                                 " intrinsic in dimension %ld: is %ld,"
+                                 " should be %ld", (long int) n+1,
+                                 (long int) ret_extent,
                                  (long int) extent[dim]);
                    
                  if (extent[dim] <= 0)
index 9f97fe4dcd6b06651bbacfa4b944c20686b4268d..00605b50d3fd3afb866b9d52c84d37f0cdcde1bb 100644 (file)
@@ -60,7 +60,18 @@ Boston, MA 02110-1301, USA.  */
 #include <ctype.h>
 
 
+/* Macros for common sets of capabilities: can we fork and exec, can
+   we use glibc-style backtrace functions, and can we use pipes.  */
+#define CAN_FORK (defined(HAVE_FORK) && defined(HAVE_EXECVP) \
+                 && defined(HAVE_WAIT))
+#define GLIBC_BACKTRACE (defined(HAVE_BACKTRACE) \
+                        && defined(HAVE_BACKTRACE_SYMBOLS))
+#define CAN_PIPE (CAN_FORK && defined(HAVE_PIPE) \
+                 && defined(HAVE_DUP2) && defined(HAVE_FDOPEN) \
+                 && defined(HAVE_CLOSE))
 
+
+#if GLIBC_BACKTRACE && CAN_PIPE
 static char *
 local_strcasestr (const char *s1, const char *s2)
 {
@@ -85,14 +96,7 @@ local_strcasestr (const char *s1, const char *s2)
     }
 #endif
 }
-
-#define CAN_FORK (defined(HAVE_FORK) && defined(HAVE_EXECVP) \
-                 && defined(HAVE_WAIT))
-#define GLIBC_BACKTRACE (defined(HAVE_BACKTRACE) \
-                        && defined(HAVE_BACKTRACE_SYMBOLS))
-#define CAN_PIPE (CAN_FORK && defined(HAVE_PIPE) \
-                 && defined(HAVE_DUP2) && defined(HAVE_FDOPEN) \
-                 && defined(HAVE_CLOSE))
+#endif
 
 
 #if GLIBC_BACKTRACE
index 86777d9c70e34ea8911c52a2ad503d46e7f09fd9..8632f152c9571c1801e3adb3a1cbee1433c850f8 100644 (file)
@@ -176,5 +176,5 @@ cleanup (void)
   close_units ();
   
   if (please_free_exe_path_when_done)
-    free (exe_path);
+    free ((char *) exe_path);
 }