diff options
| author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-03-15 07:03:20 +0000 |
|---|---|---|
| committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-03-15 07:03:20 +0000 |
| commit | 3fbab5492684265b58f60d6b6a89cb1eb6773e34 (patch) | |
| tree | f0438c5e38002a3e8f61d3718b731d9ba71ee0b6 /gcc/fortran/scanner.c | |
| parent | 8a03ad9e3419fe3cc0289bd50b1cbdbc2225e984 (diff) | |
| download | gcc-3fbab5492684265b58f60d6b6a89cb1eb6773e34.zip gcc-3fbab5492684265b58f60d6b6a89cb1eb6773e34.tar.gz gcc-3fbab5492684265b58f60d6b6a89cb1eb6773e34.tar.bz2 | |
re PR fortran/19101 (missing & in character continuation not caught)
2006-03-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/19101
* gfortran.h: Add warn_ampersand.
* invoke.texi: Add documentation for new option.
* lang.opt: Add Wampersand.
* options.c (gfc_init_options): Initialize warn_ampersand.
(gfc_post_options): Set the warn if pedantic.
(set_Wall): Set warn_ampersand.
(gfc_handle_option: Add Wampersand for itself, -std=f95, and -std=f2003.
* scanner.c (gfc_next_char_literal): Add test for missing '&' in
continued character constant and give warning if missing.
From-SVN: r112078
Diffstat (limited to 'gcc/fortran/scanner.c')
| -rw-r--r-- | gcc/fortran/scanner.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 7c09b40..d05d603 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -680,7 +680,12 @@ restart: } if (c != '&') - gfc_current_locus = old_loc; + { + if (in_string && gfc_option.warn_ampersand) + gfc_warning ("Missing '&' in continued character constant at %C"); + + gfc_current_locus.nextc--; + } } else { @@ -978,7 +983,7 @@ load_line (FILE * input, char **pbuf, int *pbuflen) if (i >= buflen) { /* Reallocate line buffer to double size to hold the - overlong line. */ + overlong line. */ buflen = buflen * 2; *pbuf = xrealloc (*pbuf, buflen + 1); buffer = (*pbuf)+i; |
