From bec38225d516144ffe9f291149aef57308cba9af Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Fri, 15 Jun 2007 10:26:16 +0000 Subject: [PATCH] re PR libfortran/32345 (Unconditional snprintf use breaks all gfortran exec tests on Tru64 UNIX V4.0F) PR libfortran/32345 * runtime/backtrace.c (show_backtrace): Only use snprintf if available. From-SVN: r125739 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/runtime/backtrace.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index cbd3e1e171b..8df6b35529b 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2007-06-15 Rainer Orth + + PR libfortran/32345 + * runtime/backtrace.c (show_backtrace): Only use snprintf if + available. + 2007-06-10 Jerry DeLisle PR libgfortran/32235 diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c index 3b17a3950bf..3577c6476a6 100644 --- a/libgfortran/runtime/backtrace.c +++ b/libgfortran/runtime/backtrace.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 Free Software Foundation, Inc. +/* Copyright (C) 2006, 2007 Free Software Foundation, Inc. Contributed by François-Xavier Coudert This file is part of the GNU Fortran 95 runtime library (libgfortran). @@ -301,7 +301,11 @@ fallback: st_printf ("\nBacktrace for this error:\n"); arg[0] = (char *) "pstack"; +#ifdef HAVE_SNPRINTF snprintf (buf, sizeof(buf), "%d", (int) getppid ()); +#else + sprintf (buf, "%d", (int) getppid ()); +#endif arg[1] = buf; arg[2] = NULL; execvp (arg[0], arg);