diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-11-03 15:22:25 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-11-03 15:22:25 +0000 |
commit | fc5f5bb7704036599b636a5e74cbb555627382bb (patch) | |
tree | d6041abde64a2fa3e650a14db834c717c03b2a4c /libgfortran/runtime | |
parent | 23782cc3783c2040847d5f21d774436e1ecc8535 (diff) | |
download | gcc-fc5f5bb7704036599b636a5e74cbb555627382bb.tar.gz |
re PR fortran/43899 (Wrong unused-variable warning with NAMELISTs)
2010-11-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/43899
* runtime/error.c (generate_warning): New function to generate a run
time warning message. Fix some whitespace.
* libgfortran.h: Add prototype for new function.
* io/list_read.c (nml_read_obj): Use new function to warn when a
character namelist object is truncated. Only warn if compiled
with -fbounds-check.
From-SVN: r166252
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r-- | libgfortran/runtime/error.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c index 65983ad4cb5..1baf9d35d1f 100644 --- a/libgfortran/runtime/error.c +++ b/libgfortran/runtime/error.c @@ -443,6 +443,20 @@ generate_error (st_parameter_common *cmp, int family, const char *message) } iexport(generate_error); + +/* generate_warning()-- Similar to generate_error but just give a warning. */ + +void +generate_warning (st_parameter_common *cmp, const char *message) +{ + if (message == NULL) + message = " "; + + show_locus (cmp); + st_printf ("Fortran runtime warning: %s\n", message); +} + + /* Whether, for a feature included in a given standard set (GFC_STD_*), we should issue an error or a warning, or be quiet. */ @@ -462,7 +476,6 @@ notification_std (int std) } - /* Possibly issue a warning/error about use of a nonstandard (or deleted) feature. An error/warning will be issued if the currently selected standard does not contain the requested bits. */ |