Bug 30605 - [4.2 only] -Wno-tabs should be active for -std=f2003 and -pedantic
Summary: [4.2 only] -Wno-tabs should be active for -std=f2003 and -pedantic
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: kargls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-26 22:15 UTC by Janne Blomqvist
Modified: 2007-02-06 00:31 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-01-27 18:01:16


Attachments
untested patch (327 bytes, patch)
2007-01-27 00:01 UTC, kargls
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janne Blomqvist 2007-01-26 22:15:52 UTC
-Wno-tabs according to the manual currently is active for -pedantic, -std=f95, and -Wall. It should be active for -std=f2003 as well. Finally, it's not actually active for -pedantic. 

% cat xtabs.f90
        print *, "hi"
end

-std=f2003 and -pedantic don't work:

% gfortran -std=f2003 xtabs.f90
%

% gfortran -pedantic xtabs.f90
%

-std=f95 and -Wall do work:

% gfortran -std=f95 xtabs.f90
xtabs.f90:1.1:

 print *, "hi"
1
Warning: Nonconforming tab character at (1)

% gfortran -Wall xtabs.f90
xtabs.f90:1.1:

 print *, "hi"
1
Warning: Nonconforming tab character at (1)
Comment 1 kargls 2007-01-27 00:01:56 UTC
Created attachment 12966 [details]
untested patch

Here's an untested patch.
Comment 2 kargls 2007-01-27 00:02:23 UTC
Confirmed.  I just attached an untested patch.
Comment 3 kargls 2007-01-27 00:45:22 UTC
Testing the patch shows -pedantic has found some invalid code
in the testsuite.
Comment 4 Janne Blomqvist 2007-01-30 23:06:23 UTC
As an aside, aren't -Wtabs and -Wno-tabs reversed? Now -Wno-tabs warns against tabs, but shouldn't it be -Wtabs that warns against using them and -Wno-tabs should turn the warning off? 
Comment 5 Steve Kargl 2007-01-30 23:09:20 UTC
Subject: Re:  -Wno-tabs should be active for -std=f2003 and -pedantic

On Tue, Jan 30, 2007 at 11:06:24PM -0000, jb at gcc dot gnu dot org wrote:
> 
> ------- Comment #4 from jb at gcc dot gnu dot org  2007-01-30 23:06 -------
> As an aside, aren't -Wtabs and -Wno-tabs reversed? Now -Wno-tabs warns against
> tabs, but shouldn't it be -Wtabs that warns against using them and -Wno-tabs
> should turn the warning off? 
> 

Well, when I wrote the original patch I interpreted -Wno-tabs
as "No tabs allowed in source", and -Wtabs is its opposite.
We can change this if others want.

Comment 6 Janne Blomqvist 2007-02-01 11:30:40 UTC
Right, I guess that's an equally valid POV. Thus, I don't think it's worth the trouble to reverse them and confuse our users.
Comment 7 kargls 2007-02-04 21:31:50 UTC
Fixed on trunk.
Comment 8 kargls 2007-02-06 00:28:25 UTC
Subject: Bug 30605

Author: kargl
Date: Tue Feb  6 00:28:14 2007
New Revision: 121631

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121631
Log:
2007-02-05  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/30605
	* fortran/invoke.texi: Update documentation.
	* fortran/options.c (gfc_post_options): Deal with tabs with -std=f2003
	and -pedantic.

2007-02-04  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/30605
	* gfortran.dg/spread_shape_1.f90: Remove tabs.
	* gfortran.dg/derived_init_2.f90: Ditto.
	* gfortran.dg/elemental_subroutine_3.f90: Ditto.
	* gfortran.dg/array_initializer_1.f90: Ditto.
	* gfortran.dg/do_2.f90: Ditto.
	* gfortran.dg/proc_assign_1.f90: Ditto.


Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/options.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/array_initializer_1.f90
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/derived_init_2.f90
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/do_2.f90
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/elemental_subroutine_3.f90
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/proc_assign_1.f90
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/spread_shape_1.f90

Comment 9 kargls 2007-02-06 00:31:02 UTC
Fixed in trunk and 4.2.  Won't fix in 4.1 or earlier.