aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime/pause.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2010-05-20 04:44:11 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2010-05-20 04:44:11 +0000
commit6d1b0f922a46b7459c0a9441f728e9214b1bcd80 (patch)
tree9eb7755ffeb7c601a8f6b2bf59f09b47b648f7a0 /libgfortran/runtime/pause.c
parentb41e2d6d522cbbf4b001d0caa381ca25e942618b (diff)
downloadgcc-6d1b0f922a46b7459c0a9441f728e9214b1bcd80.zip
gcc-6d1b0f922a46b7459c0a9441f728e9214b1bcd80.tar.gz
gcc-6d1b0f922a46b7459c0a9441f728e9214b1bcd80.tar.bz2
re PR fortran/43851 (Add _gfortran_error_stop_numeric)
2010-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/43851 * runtime/stop.c (error_stop_numeric): New function and updated comment. Add declaration for stop_numeric and remove declaration for stop_string. (stop_string): Use for blank STOP. (stop_numeric): Remove use of special -1 stop code. * runtime/pause.c (do_pause): Use stop_string for blank stop. (pause_numeric): Remove use of special -1 pause code. * gfortran.map: Add new symbol to run-time library. * libgfortran.h: Move declaration for stop_string to here to make function visible for do_pause. Remove declaration for stop_numeric. 2010-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/43851 * trans-stmt.c (gfc_trans_stop): Add generation of call to gfortran_error_stop_numeric. Fix up some whitespace. Use stop_string for blank STOP, handling a null expression. (gfc_trans_pause): Use pause_string for blank PAUSE. * trans.h: Add external function declaration for error_stop_numeric. * trans-decl.c (gfc_build_builtin_function_decls): Add the building of the declaration for the library call. Adjust whitespaces. * match.c (gfc_match_stopcode): Remove use of the actual stop code to signal no stop code. Match the expression following the stop and pass that to the translators. Remove the old use of digit matching. Add checks that the stop_code expression is INTEGER or CHARACTER, constant, and if CHARACTER, default character KIND. 2010-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/43851 * gfortran.dg/label_1.f90: Update test. From-SVN: r159609
Diffstat (limited to 'libgfortran/runtime/pause.c')
-rw-r--r--libgfortran/runtime/pause.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libgfortran/runtime/pause.c b/libgfortran/runtime/pause.c
index 7db536b..28edf6c 100644
--- a/libgfortran/runtime/pause.c
+++ b/libgfortran/runtime/pause.c
@@ -26,7 +26,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "libgfortran.h"
#include <string.h>
-
static void
do_pause (void)
{
@@ -36,26 +35,24 @@ do_pause (void)
fgets(buff, 4, stdin);
if (strncmp(buff, "go\n", 3) != 0)
- stop_numeric (-1);
+ stop_string ('\0', 0);
st_printf ("RESUMED\n");
}
-/* A numeric or blank STOP statement. */
+/* A numeric PAUSE statement. */
-extern void pause_numeric (GFC_INTEGER_4 code);
+extern void pause_numeric (GFC_INTEGER_4);
export_proto(pause_numeric);
void
pause_numeric (GFC_INTEGER_4 code)
{
- if (code == -1)
- st_printf ("PAUSE\n");
- else
- st_printf ("PAUSE %d\n", (int)code);
-
+ st_printf ("PAUSE %d\n", (int) code);
do_pause ();
}
+/* A character string or blank PAUSE statement. */
+
extern void pause_string (char *string, GFC_INTEGER_4 len);
export_proto(pause_string);