diff options
author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-11 14:16:32 +0000 |
---|---|---|
committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-11 14:16:32 +0000 |
commit | bd6f5a2a29cc5e2acc2e9cc17e191f0352088662 (patch) | |
tree | f20a2e1e472acde71a6a7f69a57c1a4bb86ab809 /gcc/fortran | |
parent | 4e37f49190c6c159c53ad79032b13e06c56e0bb9 (diff) | |
download | gcc-bd6f5a2a29cc5e2acc2e9cc17e191f0352088662.tar.gz |
PR fortran/16404
* match.c (gfc_match_program): A program name is obligatory.
(gfc_match_return): RETURN in main program is an extension.
(gfc_match_block_data): A space is required before a block data
name.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84511 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/match.c | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4ed7899f6e4..a787c9dcbee 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -6,6 +6,12 @@ PR fortran/16404 * io.c (match_io): Flag 'WRITE(...), ...' as extension. + + PR fortran/16404 + * match.c (gfc_match_program): A program name is obligatory. + (gfc_match_return): RETURN in main program is an extension. + (gfc_match_block_data): A space is required before a block data + name. 2004-07-11 Joseph S. Myers <jsm@polyomino.org.uk> diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 040142f766c..0b9dc7307d5 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -791,7 +791,7 @@ not_yes: /*********************** Statement level matching **********************/ /* Matches the start of a program unit, which is the program keyword - followed by an optional symbol. */ + followed by an obligatory symbol. */ match gfc_match_program (void) @@ -799,10 +799,6 @@ gfc_match_program (void) gfc_symbol *sym; match m; - m = gfc_match_eos (); - if (m == MATCH_YES) - return m; - m = gfc_match ("% %s%t", &sym); if (m == MATCH_NO) @@ -1897,6 +1893,13 @@ gfc_match_return (void) { gfc_expr *e; match m; + gfc_compile_state s; + + gfc_enclosing_unit (&s); + if (s == COMP_PROGRAM + && gfc_notify_std (GFC_STD_GNU, "RETURN statement in a main " + "program at %C is an extension.") == FAILURE) + return MATCH_ERROR; e = NULL; if (gfc_match_eos () == MATCH_YES) @@ -2295,7 +2298,7 @@ gfc_match_block_data (void) return MATCH_YES; } - m = gfc_match (" %n%t", name); + m = gfc_match ("% %n%t", name); if (m != MATCH_YES) return MATCH_ERROR; |