diff options
author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-11 15:06:42 +0000 |
---|---|---|
committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-11 15:06:42 +0000 |
commit | e68d273c56a00edd4e6a7ca0b1a39989dafb25cb (patch) | |
tree | 8486dc903d8c31078bde04fd506d2b5fa0f2d848 /gcc/fortran | |
parent | 0a8a047c425418431aeb6cd37de6c24b342a3eb0 (diff) | |
download | gcc-e68d273c56a00edd4e6a7ca0b1a39989dafb25cb.tar.gz |
PR fortran/16433
* primary.c (match_boz_constant): Call gfc_notify_std only if
we actually have a non-standard boz-literal-constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84514 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/primary.c | 20 |
2 files changed, 18 insertions, 8 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a787c9dcbee..966221c932a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -12,7 +12,11 @@ (gfc_match_return): RETURN in main program is an extension. (gfc_match_block_data): A space is required before a block data name. - + + PR fortran/16433 + * primary.c (match_boz_constant): Call gfc_notify_std only if + we actually have a non-standard boz-literal-constant. + 2004-07-11 Joseph S. Myers <jsm@polyomino.org.uk> * f95-lang.c (set_block): Remove. diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 35931557d84..d054bfdb55b 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -235,7 +235,7 @@ match_integer_constant (gfc_expr ** result, int signflag) static match match_boz_constant (gfc_expr ** result) { - int radix, delim, length; + int radix, delim, length, x_hex; locus old_loc; char *buffer; gfc_expr *e; @@ -244,6 +244,7 @@ match_boz_constant (gfc_expr ** result) old_loc = gfc_current_locus; gfc_gobble_whitespace (); + x_hex = 0; switch (gfc_next_char ()) { case 'b': @@ -255,12 +256,7 @@ match_boz_constant (gfc_expr ** result) rname = "octal"; break; case 'x': - if (pedantic - && (gfc_notify_std (GFC_STD_GNU, "Extension: Hexadecimal " - "constant at %C uses non-standard syntax.") - == FAILURE)) - goto backup; - + x_hex = 1; /* Fall through. */ case 'z': radix = 16; @@ -310,6 +306,16 @@ match_boz_constant (gfc_expr ** result) return MATCH_ERROR; } + if (x_hex + && pedantic + && (gfc_notify_std (GFC_STD_GNU, "Extension: Hexadecimal " + "constant at %C uses non-standard syntax.") + == FAILURE)) + { + gfc_free_expr (e); + return MATCH_ERROR; + } + *result = e; return MATCH_YES; |