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/options.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/options.c')
| -rw-r--r-- | gcc/fortran/options.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index f0ab399..ddab37e 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -52,6 +52,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, gfc_option.verbose = 0; gfc_option.warn_aliasing = 0; + gfc_option.warn_ampersand = 0; gfc_option.warn_conversion = 0; gfc_option.warn_implicit_interface = 0; gfc_option.warn_line_truncation = 0; @@ -271,6 +272,9 @@ gfc_post_options (const char **pfilename) /* Implement -fno-automatic as -fmax-stack-var-size=0. */ if (!gfc_option.flag_automatic) gfc_option.flag_max_stack_var_size = 0; + + if (pedantic) + gfc_option.warn_ampersand = 1; return false; } @@ -283,6 +287,7 @@ set_Wall (void) { gfc_option.warn_aliasing = 1; + gfc_option.warn_ampersand = 1; gfc_option.warn_line_truncation = 1; gfc_option.warn_nonstd_intrinsics = 1; gfc_option.warn_surprising = 1; @@ -385,6 +390,10 @@ gfc_handle_option (size_t scode, const char *arg, int value) gfc_option.warn_aliasing = value; break; + case OPT_Wampersand: + gfc_option.warn_ampersand = value; + break; + case OPT_Wconversion: gfc_option.warn_conversion = value; break; @@ -553,6 +562,7 @@ gfc_handle_option (size_t scode, const char *arg, int value) gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77; gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.max_identifier_length = 31; + gfc_option.warn_ampersand = 1; gfc_option.warn_tabs = 0; break; @@ -561,6 +571,7 @@ gfc_handle_option (size_t scode, const char *arg, int value) | GFC_STD_F2003 | GFC_STD_F95; gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.max_identifier_length = 63; + gfc_option.warn_ampersand = 1; break; case OPT_std_gnu: |
