on the 'Gettting started with gfortran' page at the gcc wiki,
http://gcc.gnu.org/wiki/GFortranGettingStarted
in the 'Standard conformance and other warnings' section, the following
commandline is recommended:
gfortran -std=f95 -W -Wall -pedantic mycode.f
I can't find a description of the -W switch in the gfortran
documentation ( http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gfortran/ ).
Does anyone here know what exactly it means/does?
Thanks,
Erik.
gfortran is part of gcc, the GNU C compiler, and shares many
options with gcc itself (it seems they share a common frontend).
When I can't find an option in the gfortran manpage, I usually
turn to the gcc one.
According to the gcc manpage, despite the name, there is a set of
warnings that -Wall does not enable. The -W option turns those
additional ones on. Here's the relevant bit of documentation
(with the complete list omitted):
The following -W... options are not implied by -Wall. Some
of them warn about constructions that users generally do not
consider questionable, but which occasionally you might wish
to check for; others warn about constructions that are
necessary or hard to avoid in some cases, and there is no
simple way to modify the code to suppress the warning.
-W Print extra warning messages for these events:
...
That's from the old gcc 3.3.2 manpage. Apparently -W is deprecated
now. The 4.4.0 manpage says the following:
-Wextra
This enables some extra warning flags that are not enabled by
-Wall. (This option used to be called -W. The older name is
still supported, but the newer name is more descriptive.)
...
So, if you have a newer version of gcc, you can search for -Wextra to
see the full list of warnings it enables.
--
Jason Blevins
Ph.D. Candidate, Department of Economics, Duke University
http://jblevins.org/
Thanks, that was quick.
Erik.
> On Apr 29, 2009, at 2:45 PM, Erik Toussaint wrote:
>> on the 'Gettting started with gfortran' page at the gcc wiki,
>> http://gcc.gnu.org/wiki/GFortranGettingStarted
>> in the 'Standard conformance and other warnings' section, the
>> following commandline is recommended:
>>
>> gfortran -std=f95 -W -Wall -pedantic mycode.f
>>
>> I can't find a description of the -W switch in the gfortran
>> documentation ( http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gfortran/ ).
>> Does anyone here know what exactly it means/does?
>
> gfortran is part of gcc, the GNU C compiler, and shares many
At some point the meaning of gcc was changed to GNU Compiler Collection
if I recall the bolierplate. GCC became the name for all of the compilers
that share the same middle and backends. But gcc was still the name for the
C compiler in the collection. Yes, I am confused as well.
> options with gcc itself (it seems they share a common frontend).
Surely you meant they are differing frontends to a common middle and backend.
I only meant it in the lay sense, that they share a uniform command-line
interface with a lot of common switches. I see now that the front,
middle, and back end are actually well-defined components of a
compiler so you're absolutely right.
Differing front-ends, certainly, but I think there's a common
front-front-end that does the basic option handling, where the actual
fortran front-end is not "gfortran" but instead "f951".