diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
commit | 88a3ea34080ad3087a8191fbf479543153175d59 (patch) | |
tree | 34eaec34d3588e09f9a77abba776266f124dc823 /libgfortran/runtime/stop.c | |
parent | 25e15aaed275cdfef34b3ee6eb3cb4b43a48d44f (diff) | |
parent | e65055a558093bd4fc0b1b0024b7814cc187b8e8 (diff) | |
download | gccgo.tar.gz |
Merge from trunk revision 257954.gccgo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gccgo@257955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime/stop.c')
-rw-r--r-- | libgfortran/runtime/stop.c | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c index 6f8b62f8385..1e6dd8c28d0 100644 --- a/libgfortran/runtime/stop.c +++ b/libgfortran/runtime/stop.c @@ -81,14 +81,17 @@ report_exception (void) /* A numeric STOP statement. */ -extern _Noreturn void stop_numeric (GFC_INTEGER_4); +extern _Noreturn void stop_numeric (int, bool); export_proto(stop_numeric); void -stop_numeric (GFC_INTEGER_4 code) +stop_numeric (int code, bool quiet) { - report_exception (); - st_printf ("STOP %d\n", (int)code); + if (!quiet) + { + report_exception (); + st_printf ("STOP %d\n", code); + } exit (code); } @@ -96,14 +99,17 @@ stop_numeric (GFC_INTEGER_4 code) /* A character string or blank STOP statement. */ void -stop_string (const char *string, GFC_INTEGER_4 len) +stop_string (const char *string, size_t len, bool quiet) { - report_exception (); - if (string) + if (!quiet) { - estr_write ("STOP "); - (void) write (STDERR_FILENO, string, len); - estr_write ("\n"); + report_exception (); + if (string) + { + estr_write ("STOP "); + (void) write (STDERR_FILENO, string, len); + estr_write ("\n"); + } } exit (0); } @@ -114,30 +120,35 @@ stop_string (const char *string, GFC_INTEGER_4 len) initiates error termination of execution." Thus, error_stop_string returns a nonzero exit status code. */ -extern _Noreturn void error_stop_string (const char *, GFC_INTEGER_4); +extern _Noreturn void error_stop_string (const char *, size_t, bool); export_proto(error_stop_string); void -error_stop_string (const char *string, GFC_INTEGER_4 len) +error_stop_string (const char *string, size_t len, bool quiet) { - report_exception (); - estr_write ("ERROR STOP "); - (void) write (STDERR_FILENO, string, len); - estr_write ("\n"); - + if (!quiet) + { + report_exception (); + estr_write ("ERROR STOP "); + (void) write (STDERR_FILENO, string, len); + estr_write ("\n"); + } exit_error (1); } /* A numeric ERROR STOP statement. */ -extern _Noreturn void error_stop_numeric (GFC_INTEGER_4); +extern _Noreturn void error_stop_numeric (int, bool); export_proto(error_stop_numeric); void -error_stop_numeric (GFC_INTEGER_4 code) +error_stop_numeric (int code, bool quiet) { - report_exception (); - st_printf ("ERROR STOP %d\n", (int) code); + if (!quiet) + { + report_exception (); + st_printf ("ERROR STOP %d\n", code); + } exit_error (code); } |