+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.
#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
#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
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
{
- 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)
#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)
{
}
#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
close_units ();
if (please_free_exe_path_when_done)
- free (exe_path);
+ free ((char *) exe_path);
}