aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobi@gcc.gnu.org>2005-08-14 23:45:03 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2005-08-14 23:45:03 +0200
commit2b22401b5adc55029fb08feeb725058aa8020bb0 (patch)
tree5bcc450591802544d95405b27ffc95f59b89821f /gcc/fortran/parse.c
parent21d7d31f71d4c4e16ee17ac547d3e0b6963e8ba1 (diff)
downloadgcc-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
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c13
1 files changed, 8 insertions, 5 deletions
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)