diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-18 21:25:21 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-18 21:25:21 +0000 |
commit | 1e346579d79c5fda24828961ae67f389658f8c3a (patch) | |
tree | 0769a04922654613317a07a6b2f817cda89a8b9e /libgfortran/runtime | |
parent | a9b1e587884f7863872f65e817b0645449547196 (diff) | |
download | gcc-1e346579d79c5fda24828961ae67f389658f8c3a.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129463 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r-- | libgfortran/runtime/backtrace.c | 20 | ||||
-rw-r--r-- | libgfortran/runtime/main.c | 2 |
2 files changed, 13 insertions, 9 deletions
diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c index 9f97fe4dcd6..00605b50d3f 100644 --- a/libgfortran/runtime/backtrace.c +++ b/libgfortran/runtime/backtrace.c @@ -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 diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c index 86777d9c70e..8632f152c95 100644 --- a/libgfortran/runtime/main.c +++ b/libgfortran/runtime/main.c @@ -176,5 +176,5 @@ cleanup (void) close_units (); if (please_free_exe_path_when_done) - free (exe_path); + free ((char *) exe_path); } |