diff options
author | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-08-14 23:45:03 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-08-14 23:45:03 +0200 |
commit | 2b22401b5adc55029fb08feeb725058aa8020bb0 (patch) | |
tree | 5bcc450591802544d95405b27ffc95f59b89821f | |
parent | 21d7d31f71d4c4e16ee17ac547d3e0b6963e8ba1 (diff) | |
download | gcc-2b22401b5adc55029fb08feeb725058aa8020bb0.zip gcc-2b22401b5adc55029fb08feeb725058aa8020bb0.tar.gz gcc-2b22401b5adc55029fb08feeb725058aa8020bb0.tar.bz2 |
parse.c (match): Enclosed macro in do...while(0) and braces.
2005-08-14 Asher Langton <langton2@llnl.gov>
* parse.c (match): Enclosed macro in do...while(0) and braces.
Also fix formatting of a few previous ChangeLog entries
From-SVN: r103086
-rw-r--r-- | gcc/fortran/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/fortran/parse.c | 13 |
2 files changed, 16 insertions, 9 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d92bfd4..2d4a86a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,9 +1,13 @@ -2005-08-14 Paul Thomas <pault@gcc.gnu.org> +2005-08-14 Asher Langton <langton2@llnl.gov> + + * parse.c (match): Enclosed macro in do...while(0) and braces. + +2005-08-14 Paul Thomas <pault@gcc.gnu.org> PR fortran/21432. * gfortran.texi: Document PRINT namelist. -2005-08-14 Paul Thomas <pault@gcc.gnu.org> +2005-08-14 Paul Thomas <pault@gcc.gnu.org> PR fortran/21432. * io.c (match_io): Add code to implement PRINT namelist. @@ -178,7 +182,7 @@ * trans-stmt.c (gfc_trans_character_select): Use build_constructor_from_list instead of build_constructor. -2005-07-19 Paul Thomas <pault@gcc.gnu.org> +2005-07-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/16940 * resolve.c (resolve_symbol): A symbol with FL_UNKNOWN @@ -918,7 +922,7 @@ * resolve.c (resolve_variable): If e->symtree is not set, this ought to be a FAILURE, and not a segfault. -2005-04-17 Paul Thomas <pault@gcc.gnu.org> +2005-04-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/17472 PR fortran/18209 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 2894e50..9c404d5 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -75,13 +75,16 @@ match_word (const char *str, match (*subr) (void), locus * old_locus) /* Figure out what the next statement is, (mostly) regardless of - proper ordering. */ + proper ordering. The do...while(0) is there to prevent if/else + ambiguity. */ #define match(keyword, subr, st) \ - if (match_word(keyword, subr, &old_locus) == MATCH_YES) \ - return st; \ - else \ - undo_new_statement (); + do { \ + if (match_word(keyword, subr, &old_locus) == MATCH_YES) \ + return st; \ + else \ + undo_new_statement (); \ + } while (0); static gfc_statement decode_statement (void) |