Commit 16db2a6a by Tobias Burnus Committed by Tobias Burnus

gfortran.h (gfc_option_t): Remove warn_tabs.

2014-11-23  Tobias Burnus  <burnus@net-b.de>
        Manuel López-Ibáñez  <manu@gcc.gnu.org>

gcc/fortran/
        * gfortran.h (gfc_option_t): Remove warn_tabs.
        * lang.opt (Wpedantic): Add.
        (Wtabs): Use Var and LangEnabledBy.
        * options.c (gfc_init_options, gfc_post_options,
        set_Wall): Remove -Wtabs handling.
        (gfc_handle_option): Update -std=, remove OPT_Wtabs.
        * scanner.c (gfc_gobble_whitespace): Update for
        flag-variable renaming.
        (load_line): Ditto. Pass warn flag to diagnostic.

gcc/testsuite/
        * gfortran.dg/tab_continuation.f: Update dg-*.


Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>

From-SVN: r217985
parent 5e383359
2014-11-23 Tobias Burnus <burnus@net-b.de>
Manuel López-Ibáñez <manu@gcc.gnu.org>
* gfortran.h (gfc_option_t): Remove warn_tabs.
* lang.opt (Wpedantic): Add.
(Wtabs): Use Var and LangEnabledBy.
* options.c (gfc_init_options, gfc_post_options,
set_Wall): Remove -Wtabs handling.
(gfc_handle_option): Update -std=, remove OPT_Wtabs.
* scanner.c (gfc_gobble_whitespace): Update for
flag-variable renaming.
(load_line): Ditto. Pass warn flag to diagnostic.
2014-11-22 Tobias Burnus <burnus@net-b.de> 2014-11-22 Tobias Burnus <burnus@net-b.de>
* trans-expr.c (gfc_caf_get_image_index): Fix image calculation. * trans-expr.c (gfc_caf_get_image_index): Fix image calculation.
......
...@@ -2452,7 +2452,6 @@ typedef struct ...@@ -2452,7 +2452,6 @@ typedef struct
int warn_implicit_procedure; int warn_implicit_procedure;
int warn_line_truncation; int warn_line_truncation;
int warn_surprising; int warn_surprising;
int warn_tabs;
int warn_underflow; int warn_underflow;
int warn_intrinsic_shadow; int warn_intrinsic_shadow;
int warn_intrinsics_std; int warn_intrinsics_std;
......
...@@ -269,6 +269,10 @@ Wopenmp-simd ...@@ -269,6 +269,10 @@ Wopenmp-simd
Fortran Fortran
; Documented in C ; Documented in C
Wpedantic
Fortran
; Documented in common.opt
Wreal-q-constant Wreal-q-constant
Fortran Warning Fortran Warning
Warn about real-literal-constants with 'q' exponent-letter Warn about real-literal-constants with 'q' exponent-letter
...@@ -294,9 +298,13 @@ Fortran Warning ...@@ -294,9 +298,13 @@ Fortran Warning
Warn about \"suspicious\" constructs Warn about \"suspicious\" constructs
Wtabs Wtabs
Fortran Warning Fortran Warning Var(warn_tabs) LangEnabledBy(Fortran,Wall)
Permit nonconforming uses of the tab character Permit nonconforming uses of the tab character
Wtabs
LangEnabledBy(Fortran,Wpedantic)
;
Wunderflow Wunderflow
Fortran Warning Fortran Warning
Warn about underflow of numerical constant expressions Warn about underflow of numerical constant expressions
......
...@@ -104,7 +104,6 @@ gfc_init_options (unsigned int decoded_options_count, ...@@ -104,7 +104,6 @@ gfc_init_options (unsigned int decoded_options_count,
gfc_option.warn_implicit_interface = 0; gfc_option.warn_implicit_interface = 0;
gfc_option.warn_line_truncation = 0; gfc_option.warn_line_truncation = 0;
gfc_option.warn_surprising = 0; gfc_option.warn_surprising = 0;
gfc_option.warn_tabs = 1;
gfc_option.warn_underflow = 1; gfc_option.warn_underflow = 1;
gfc_option.warn_intrinsic_shadow = 0; gfc_option.warn_intrinsic_shadow = 0;
gfc_option.warn_intrinsics_std = 0; gfc_option.warn_intrinsics_std = 0;
...@@ -430,10 +429,7 @@ gfc_post_options (const char **pfilename) ...@@ -430,10 +429,7 @@ gfc_post_options (const char **pfilename)
gfc_option.flag_max_stack_var_size = 0; gfc_option.flag_max_stack_var_size = 0;
if (pedantic) if (pedantic)
{ gfc_option.warn_ampersand = 1;
gfc_option.warn_ampersand = 1;
gfc_option.warn_tabs = 0;
}
/* Optimization implies front end optimization, unless the user /* Optimization implies front end optimization, unless the user
specified it directly. */ specified it directly. */
...@@ -461,7 +457,6 @@ set_Wall (int setting) ...@@ -461,7 +457,6 @@ set_Wall (int setting)
gfc_option.gfc_warn_conversion = setting; gfc_option.gfc_warn_conversion = setting;
gfc_option.warn_line_truncation = setting; gfc_option.warn_line_truncation = setting;
gfc_option.warn_surprising = setting; gfc_option.warn_surprising = setting;
gfc_option.warn_tabs = !setting;
gfc_option.warn_underflow = setting; gfc_option.warn_underflow = setting;
gfc_option.warn_intrinsic_shadow = setting; gfc_option.warn_intrinsic_shadow = setting;
gfc_option.warn_intrinsics_std = setting; gfc_option.warn_intrinsics_std = setting;
...@@ -720,10 +715,6 @@ gfc_handle_option (size_t scode, const char *arg, int value, ...@@ -720,10 +715,6 @@ gfc_handle_option (size_t scode, const char *arg, int value,
gfc_option.warn_surprising = value; gfc_option.warn_surprising = value;
break; break;
case OPT_Wtabs:
gfc_option.warn_tabs = value;
break;
case OPT_Wtarget_lifetime: case OPT_Wtarget_lifetime:
gfc_option.warn_target_lifetime = value; gfc_option.warn_target_lifetime = value;
break; break;
...@@ -1038,7 +1029,7 @@ gfc_handle_option (size_t scode, const char *arg, int value, ...@@ -1038,7 +1029,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
gfc_option.max_continue_free = 39; gfc_option.max_continue_free = 39;
gfc_option.max_identifier_length = 31; gfc_option.max_identifier_length = 31;
gfc_option.warn_ampersand = 1; gfc_option.warn_ampersand = 1;
gfc_option.warn_tabs = 0; warn_tabs = 1;
break; break;
case OPT_std_f2003: case OPT_std_f2003:
...@@ -1047,7 +1038,7 @@ gfc_handle_option (size_t scode, const char *arg, int value, ...@@ -1047,7 +1038,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.warn_std = GFC_STD_F95_OBS;
gfc_option.max_identifier_length = 63; gfc_option.max_identifier_length = 63;
gfc_option.warn_ampersand = 1; gfc_option.warn_ampersand = 1;
gfc_option.warn_tabs = 0; warn_tabs = 1;
break; break;
case OPT_std_f2008: case OPT_std_f2008:
...@@ -1056,7 +1047,7 @@ gfc_handle_option (size_t scode, const char *arg, int value, ...@@ -1056,7 +1047,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS;
gfc_option.max_identifier_length = 63; gfc_option.max_identifier_length = 63;
gfc_option.warn_ampersand = 1; gfc_option.warn_ampersand = 1;
gfc_option.warn_tabs = 0; warn_tabs = 1;
break; break;
case OPT_std_f2008ts: case OPT_std_f2008ts:
...@@ -1066,7 +1057,7 @@ gfc_handle_option (size_t scode, const char *arg, int value, ...@@ -1066,7 +1057,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS;
gfc_option.max_identifier_length = 63; gfc_option.max_identifier_length = 63;
gfc_option.warn_ampersand = 1; gfc_option.warn_ampersand = 1;
gfc_option.warn_tabs = 0; warn_tabs = 1;
break; break;
case OPT_std_gnu: case OPT_std_gnu:
......
...@@ -1382,7 +1382,7 @@ gfc_gobble_whitespace (void) ...@@ -1382,7 +1382,7 @@ gfc_gobble_whitespace (void)
/* Issue a warning for nonconforming tabs. We keep track of the line /* Issue a warning for nonconforming tabs. We keep track of the line
number because the Fortran matchers will often back up and the same number because the Fortran matchers will often back up and the same
line will be scanned multiple times. */ line will be scanned multiple times. */
if (!gfc_option.warn_tabs && c == '\t') if (warn_tabs && c == '\t')
{ {
int cur_linenum = LOCATION_LINE (gfc_current_locus.lb->location); int cur_linenum = LOCATION_LINE (gfc_current_locus.lb->location);
if (cur_linenum != linenum) if (cur_linenum != linenum)
...@@ -1534,12 +1534,12 @@ load_line (FILE *input, gfc_char_t **pbuf, int *pbuflen, const int *first_char) ...@@ -1534,12 +1534,12 @@ load_line (FILE *input, gfc_char_t **pbuf, int *pbuflen, const int *first_char)
{ {
found_tab = true; found_tab = true;
if (!gfc_option.warn_tabs && seen_comment == 0 if (warn_tabs && seen_comment == 0 && current_line != linenum)
&& current_line != linenum)
{ {
linenum = current_line; linenum = current_line;
gfc_warning_now_2 ("Nonconforming tab character in column %d " gfc_warning_now_2 (OPT_Wtabs,
"of line %d", i+1, linenum); "Nonconforming tab character in column %d "
"of line %d", i+1, linenum);
} }
while (i < 6) while (i < 6)
......
2014-11-23 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/tab_continuation.f: Update dg-*.
2014-11-23 Andrew Pinski <apinski@cavium.com> 2014-11-23 Andrew Pinski <apinski@cavium.com>
* gcc.c-torture/compile/20120927-1.c: New testcase. * gcc.c-torture/compile/20120927-1.c: New testcase.
......
...@@ -5,11 +5,16 @@ ...@@ -5,11 +5,16 @@
! Allow <tab>1 to <tab>9 as continuation marker, which is a very common ! Allow <tab>1 to <tab>9 as continuation marker, which is a very common
! vendor extension. ! vendor extension.
! !
! Note: The test suite is run with -pedantic-errors, which both enables
! the tab warning (-pedantic implies -Wtabs) and turns it into errors
! (-pedantic-errors hence implies -Werror=tabs).
!
PARAMETER (LUMIN=11,LUMAX=20,MAPMAX=256,NPLANEMAX=999) PARAMETER (LUMIN=11,LUMAX=20,MAPMAX=256,NPLANEMAX=999)
INTEGER NAXIS(0:MAPMAX,LUMIN:LUMAX),NAXIS1(0:MAPMAX,LUMIN:LUMAX), INTEGER NAXIS(0:MAPMAX,LUMIN:LUMAX),NAXIS1(0:MAPMAX,LUMIN:LUMAX),
1NAXIS2(0:MAPMAX,LUMIN:LUMAX),NAXIS3(0:MAPMAX,LUMIN:LUMAX) 1NAXIS2(0:MAPMAX,LUMIN:LUMAX),NAXIS3(0:MAPMAX,LUMIN:LUMAX)
end end
! { dg-warning "Nonconforming tab character in column 1 of line 8" "Nonconforming tab" { target *-*-* } 0 } ! { dg-error "Nonconforming tab character in column 1 of line 12" "Nonconforming tab" { target *-*-* } 0 }
! { dg-warning "Nonconforming tab character in column 1 of line 9" "Nonconforming tab" { target *-*-* } 0 } ! { dg-error "Nonconforming tab character in column 1 of line 13" "Nonconforming tab" { target *-*-* } 0 }
! { dg-warning "Nonconforming tab character in column 1 of line 10" "Nonconforming tab" { target *-*-* } 0 } ! { dg-error "Nonconforming tab character in column 1 of line 14" "Nonconforming tab" { target *-*-* } 0 }
! { dg-warning "Nonconforming tab character in column 1 of line 11" "Nonconforming tab" { target *-*-* } 0 } ! { dg-error "Nonconforming tab character in column 1 of line 15" "Nonconforming tab" { target *-*-* } 0 }
! { dg-excess-errors "some warnings being treated as errors" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment