[patch, fortran] Handle -Wextra, -fcompare-reals is implied with -Wextra

Manuel López-Ibáñez lopezibanez@gmail.com
Sun Sep 23 22:57:00 GMT 2012


On 23 September 2012 21:58, Thomas Koenig <tkoenig@netcologne.de> wrote:
> Hello world,
>
> the attatched patch (this time for real!) implements
> -Wextra for the Fortran front end, and adds -fcompare-reals
> to -Wextra.
>
> @manu:  In the PR, you mentioned that it would be nice if
> LangEnabledBy was used in the opt files.  I tried adding that
> to the common.opt file for Wextra, but that led to the following
> regressions:

The usage should be to add LangEnabledBy(Fortran,Wextra) to
fortran/lang.opt, see the examples in c-family/c.opt. However, the
actual problem seems to be that gfortran uses their own option
variables and not the ones generated by the common machinery (which
are generated in any case, so it is a bit of a waste to duplicate
them).

It is up to the gfortran maintainers to enforce using the common
machinery or keep re-inventing the wheel.  If gfortran wants to ever
support -Werror= and #pragma GCC diagnostics and other such goodies,
all this code will need to be eventually moved to the common machinery
(or duplicate the features in the Fortran FE).

Cheers,

Manuel.



More information about the Gcc-patches mailing list