aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/write.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2015-09-02 17:51:40 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2015-09-02 17:51:40 +0300
commit1b0b9fcb928042bf30fb2e42247912d226f85513 (patch)
tree10abb98957304dbdbbb310cad62b7d3c654bb167 /libgfortran/io/write.c
parent710465235b06be5b74b7fda1c8e2092b43d83e01 (diff)
downloadgcc-1b0b9fcb928042bf30fb2e42247912d226f85513.zip
gcc-1b0b9fcb928042bf30fb2e42247912d226f85513.tar.gz
gcc-1b0b9fcb928042bf30fb2e42247912d226f85513.tar.bz2
PR 67414 Better diagnostics on backtrace failure, gf_strerror bugfix
2015-09-02 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/67414 * io/write.c (gfc_itoa): Move to runtime/string.c. * libgfortran.h (show_backtrace): Make arg bool. (gfc_itoa): New prototype. * runtime/backtrace.c (struct mystate): Change type of try_simple field, add in_signal_handler field. (error_callback): Print out error number, or if not in a signal handler, the error message. (show_backtrace): Change type of arg, change initialization of struct mystate. (backtrace): Call show_backtrace with correct arg type. * runtime/compile_options.c (backtrace_handler): Call with correct arg type. * runtime/error.c (sys_abort): Likewise. (gf_strerror): Handle newlocale() failure. * runtime/string.c (gfc_itoa): Function moved here from io/write.c. From-SVN: r227404
Diffstat (limited to 'libgfortran/io/write.c')
-rw-r--r--libgfortran/io/write.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 7599659..e226236 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -1032,47 +1032,6 @@ ztoa_big (const char *s, char *buffer, int len, GFC_UINTEGER_LARGEST *n)
return buffer;
}
-/* gfc_itoa()-- Integer to decimal conversion.
- The itoa function is a widespread non-standard extension to standard
- C, often declared in <stdlib.h>. Even though the itoa defined here
- is a static function we take care not to conflict with any prior
- non-static declaration. Hence the 'gfc_' prefix, which is normally
- reserved for functions with external linkage. */
-
-static const char *
-gfc_itoa (GFC_INTEGER_LARGEST n, char *buffer, size_t len)
-{
- int negative;
- char *p;
- GFC_UINTEGER_LARGEST t;
-
- assert (len >= GFC_ITOA_BUF_SIZE);
-
- if (n == 0)
- return "0";
-
- negative = 0;
- t = n;
- if (n < 0)
- {
- negative = 1;
- t = -n; /*must use unsigned to protect from overflow*/
- }
-
- p = buffer + GFC_ITOA_BUF_SIZE - 1;
- *p = '\0';
-
- while (t != 0)
- {
- *--p = '0' + (t % 10);
- t /= 10;
- }
-
- if (negative)
- *--p = '-';
- return p;
-}
-
void
write_i (st_parameter_dt *dtp, const fnode *f, const char *p, int len)