Code::Blocks

User forums => Using Code::Blocks => Topic started by: gib on September 30, 2019, 12:42:21 am

Title: gfortran - nonconforming tabs warning
Post by: gib on September 30, 2019, 12:42:21 am
Since my Fortran code has a great number of tabs, the compiler warning is very annoying - the great number of tabs warning messages drowning out other warnings.  I've followed suggestions that either -Wtabs or -Wno-tabs has the effect of suppressing these warnings, but in CB neither has that effect.  Does somebody know the solution to this?

Thanks
Gib
Title: Re: gfortran - nonconforming tabs warning
Post by: oBFusCATed on September 30, 2019, 12:52:49 am
These instructions might help: http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Title: Re: gfortran - nonconforming tabs warning
Post by: gib on September 30, 2019, 06:05:03 am
No, that doesn't help.  I'm sure some other Fortran programmers using CB must have encountered this issue.
To check how gfortran behaves outside of CB, I compiled a trivial test program:
Code: [Select]
program main
integer :: i, j, k
k = 0
do i = 1,10
do j = 1,3
k = k+10
enddo
enddo
write(*,*) 'k: ',k
end program

where the indentation on lines 5,6,7 uses tabs.

Compiled with
>gfortran -c test.f90
there are no warnings.
With
>gfortran -c -Wtabs test.f90
there are 3 tabs warnings
With
>gfortran -c -Wno-tabs test.f90
there are no warnings.

Using -Wtabs, -Wno-tabs or no compiler option in CB gives tabs warnings.  I have not been able to find any combination of compiler switches that turns these warnings off.  It is frustrating.
Title: Re: gfortran - nonconforming tabs warning
Post by: oBFusCATed on September 30, 2019, 02:46:02 pm
It says this:
Quote
I would start by turning on full Compiler logging.

This is done by selecting the "Full command line" option Under menu "Settings" -> "Compiler" -> Global compiler settings -> [the compiler you use] -> "Other Setting" tab, "Compiler logging". In 12.11 and newer this is enabled by default.
...
* You should review all the commands and their options;
...

Have you done it? Are they the same as the ones for your command line invocation of the compiler?

Title: Re: gfortran - nonconforming tabs warning
Post by: BlueHazzard on September 30, 2019, 03:01:18 pm
Also
Quote
If you have no luck, you can try to ask in the forum, but read first "How do I report a compilation problem on the forums"
and there:
Quote
Build log:
Code: [Select]
Paste full build log here. (It is found in the 'Build log' tab). Please make always a 'rebuild' (Menu: Build->Rebuild) or a 'clean' and 'build' before you copy the full build log.
Title: Re: gfortran - nonconforming tabs warning
Post by: gib on October 02, 2019, 01:05:41 am
I have discovered that contrary to my expectations, the compiler options in Settings override (occur later in the gfortran command line) those in Build options.  In Settings (for no apparent reason) I had -Wtabs in the Other compiler options.  My mistakes, in other words. 
Apologies for time wasted on this.