aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2005-12-03 16:32:04 +0100
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2005-12-03 15:32:04 +0000
commita34a91f0b73dad394cd0db44f5702406c09a06c6 (patch)
treefed5540ea5770fb73224878dea9cced4affb486c /gcc/fortran/parse.c
parent1b2bb2edfa74093b2926ca0673e845edd7f5f8a5 (diff)
downloadgcc-a34a91f0b73dad394cd0db44f5702406c09a06c6.zip
gcc-a34a91f0b73dad394cd0db44f5702406c09a06c6.tar.gz
gcc-a34a91f0b73dad394cd0db44f5702406c09a06c6.tar.bz2
re PR fortran/25106 ([4.0/4.1] statement label is zero)
PR fortran/25106 * parse.c (next_free): Use new prototype for gfc_match_st_label. Correctly emit hard error if a label is zero. * match.c (gfc_match_st_label): Never allow zero as a valid label. (gfc_match, gfc_match_do, gfc_match_goto): Use new prototype for gfc_match_st_label. * primary.c (): Use new prototype for gfc_match_st_label. * io.c (): Likewise. * match.h: Likewise. From-SVN: r107999
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 0fc8f96..311d10a 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -318,30 +318,25 @@ next_free (void)
if (ISDIGIT (c))
{
/* Found a statement label? */
- m = gfc_match_st_label (&gfc_statement_label, 0);
+ m = gfc_match_st_label (&gfc_statement_label);
d = gfc_peek_char ();
if (m != MATCH_YES || !gfc_is_whitespace (d))
{
+ gfc_match_small_literal_int (&c);
+ if (c == 0)
+ gfc_error_now ("Statement label at %C is zero");
+ else
+ gfc_error_now ("Statement label at %C is out of range");
+
do
- {
- /* Skip the bad statement label. */
- gfc_warning_now ("Ignoring bad statement label at %C");
- c = gfc_next_char ();
- }
- while (ISDIGIT (c));
+ c = gfc_next_char ();
+ while (ISDIGIT(c));
}
else
{
label_locus = gfc_current_locus;
- if (gfc_statement_label->value == 0)
- {
- gfc_warning_now ("Ignoring statement label of zero at %C");
- gfc_free_st_label (gfc_statement_label);
- gfc_statement_label = NULL;
- }
-
gfc_gobble_whitespace ();
if (gfc_match_eos () == MATCH_YES)