summaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-04 01:36:31 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-04 01:36:31 +0000
commit02183b453439daa65fc2bb205afef9428f106023 (patch)
treef2a85db2fbef8080a2e4fd3757e25014aaf79285 /libgfortran/io
parent3b146c36e3f5c94d0b2f5b3a2a4a9667d573ad4c (diff)
downloadgcc-02183b453439daa65fc2bb205afef9428f106023.tar.gz
2006-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/27704 * runtime/error.c (notify_std): Pass common flags into function. Use flags to show locus of error or warning. * libgfortran.h: Add enum try. Add prototype for notify_std. * io/open.c (edit_modes): Allow status="old" and add extension to allow status="scratch" *io/list_read.c (nml_read_obj): Update call to notify_std. *io/io.h: Remove enum try and prototype for notify_std. *io/transfer.c (read_sf): Update call to notify_std. *io/format.c (parse_format_list): Update call to notify_std. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115168 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/format.c4
-rw-r--r--libgfortran/io/io.h7
-rw-r--r--libgfortran/io/list_read.c2
-rw-r--r--libgfortran/io/open.c12
-rw-r--r--libgfortran/io/transfer.c3
5 files changed, 14 insertions, 14 deletions
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index 5af5c6e8bde..aa6c68bbf25 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -575,7 +575,7 @@ parse_format_list (st_parameter_dt *dtp)
case FMT_DOLLAR:
get_fnode (fmt, &head, &tail, FMT_DOLLAR);
tail->repeat = 1;
- notify_std (GFC_STD_GNU, "Extension: $ descriptor");
+ notify_std (&dtp->common, GFC_STD_GNU, "Extension: $ descriptor");
goto between_desc;
case FMT_T:
@@ -671,7 +671,7 @@ parse_format_list (st_parameter_dt *dtp)
{
fmt->saved_token = t;
fmt->value = 1; /* Default width */
- notify_std(GFC_STD_GNU, posint_required);
+ notify_std (&dtp->common, GFC_STD_GNU, posint_required);
}
}
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index aa8a6a693f7..822930e776a 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -46,10 +46,6 @@ typedef enum
bt;
-typedef enum
-{ SUCCESS = 1, FAILURE }
-try;
-
struct st_parameter_dt;
typedef struct stream
@@ -865,9 +861,6 @@ extern void list_formatted_write (st_parameter_dt *, bt, void *, int, size_t,
internal_proto(list_formatted_write);
/* error.c */
-extern try notify_std (int, const char *);
-internal_proto(notify_std);
-
extern notification notification_std(int);
internal_proto(notification_std);
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 0670efab86f..0dcb3dba688 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2214,7 +2214,7 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
and set the flag to zero to prevent further warnings. */
if (dtp->u.p.expanded_read == 2)
{
- notify_std (GFC_STD_GNU, "Non-standard expanded namelist read.");
+ notify_std (&dtp->common, GFC_STD_GNU, "Non-standard expanded namelist read.");
dtp->u.p.expanded_read = 0;
}
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index 24713b76f49..3515bef75ce 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -128,7 +128,7 @@ edit_modes (st_parameter_open *opp, gfc_unit * u, unit_flags * flags)
{
/* Complain about attempts to change the unchangeable. */
- if (flags->status != STATUS_UNSPECIFIED &&
+ if (flags->status != STATUS_UNSPECIFIED && flags->status != STATUS_OLD &&
u->flags.status != flags->status)
generate_error (&opp->common, ERROR_BAD_OPTION,
"Cannot change STATUS parameter in OPEN statement");
@@ -154,8 +154,14 @@ edit_modes (st_parameter_open *opp, gfc_unit * u, unit_flags * flags)
if (flags->status != STATUS_UNSPECIFIED && flags->status != STATUS_OLD &&
flags->status != STATUS_UNKNOWN)
- generate_error (&opp->common, ERROR_BAD_OPTION,
+ {
+ if (flags->status == STATUS_SCRATCH)
+ notify_std (&opp->common, GFC_STD_GNU,
+ "OPEN statement must have a STATUS of OLD or UNKNOWN");
+ else
+ generate_error (&opp->common, ERROR_BAD_OPTION,
"OPEN statement must have a STATUS of OLD or UNKNOWN");
+ }
if (u->flags.form == FORM_UNFORMATTED)
{
@@ -615,7 +621,7 @@ st_open (st_parameter_open *opp)
"Conflicting ACCESS and POSITION flags in"
" OPEN statement");
- notify_std (GFC_STD_GNU,
+ notify_std (&opp->common, GFC_STD_GNU,
"Extension: APPEND as a value for ACCESS in OPEN statement");
flags.access = ACCESS_SEQUENTIAL;
flags.position = POSITION_APPEND;
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 15d403c5714..9b91536d077 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -220,7 +220,8 @@ read_sf (st_parameter_dt *dtp, int *length, int no_error)
if (*q == ',')
if (dtp->u.p.sf_read_comma == 1)
{
- notify_std (GFC_STD_GNU, "Comma in formatted numeric read.");
+ notify_std (&dtp->common, GFC_STD_GNU,
+ "Comma in formatted numeric read.");
*length = n;
break;
}