aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime/backtrace.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gmail.com>2021-12-25 15:07:12 +0100
committerFrancois-Xavier Coudert <fxcoudert@gmail.com>2021-12-25 15:07:12 +0100
commit4ae906e46c4c173b79c9c60c6157ff68e05f7464 (patch)
tree30547d298d8ea29320e37d7e765c363ff22135ee /libgfortran/runtime/backtrace.c
parentffb5418fb79e951e4a8cc818e2408106aa58b9a8 (diff)
downloadgcc-4ae906e46c4c173b79c9c60c6157ff68e05f7464.zip
gcc-4ae906e46c4c173b79c9c60c6157ff68e05f7464.tar.gz
gcc-4ae906e46c4c173b79c9c60c6157ff68e05f7464.tar.bz2
Fortran: simplify library code for integer-to-decimal conversion
libgfortran/ChangeLog: PR libfortran/81986 PR libfortran/99191 * libgfortran.h: Remove gfc_xtoa(), adjust gfc_itoa() and GFC_ITOA_BUF_SIZE. * io/write.c (write_decimal): conversion parameter is always gfc_itoa(), so remove it. Protect from overflow. (xtoa): Move gfc_xtoa and update its name. (xtoa_big): Renamed from ztoa_big for consistency. (write_z): Adjust to new function names. (write_i, write_integer): Remove last arg of write_decimal. * runtime/backtrace.c (error_callback): Comment on the use of gfc_itoa(). * runtime/error.c (gfc_xtoa): Move to io/write.c. * runtime/string.c (gfc_itoa): Take an unsigned argument, remove the handling of negative values.
Diffstat (limited to 'libgfortran/runtime/backtrace.c')
-rw-r--r--libgfortran/runtime/backtrace.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c
index 5ac0831..403c7c3 100644
--- a/libgfortran/runtime/backtrace.c
+++ b/libgfortran/runtime/backtrace.c
@@ -97,6 +97,7 @@ error_callback (void *data, const char *msg, int errnum)
iov[1].iov_len = strlen (msg);
iov[2].iov_base = (char*) ", errno: ";
iov[2].iov_len = strlen (iov[2].iov_base);
+ /* Async-signal-safe function, errnum must be positive. */
const char *p = gfc_itoa (errnum, errbuf, sizeof (errbuf));
iov[3].iov_base = (char*) p;
iov[3].iov_len = strlen (p);