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
This commit is contained in:
Rainer Orth 2007-06-15 10:26:16 +00:00 committed by Rainer Orth
parent 2be6658d86
commit bec38225d5
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-06-15 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR libfortran/32345
* runtime/backtrace.c (show_backtrace): Only use snprintf if
available.
2007-06-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/32235

View File

@ -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);