[patch, fortran] RFD: PR 56666 Allow suppression of zero-trip DO loop warning
Janus Weil
janus@gcc.gnu.org
Tue Aug 6 10:42:00 GMT 2013
Hi Thomas,
> the rather self-explanatory patch implements the -Wzerotrip
> option. The positive form is not really useful, because
> the option is on by default (so the default behavior is
> not changed).
>
> The negative form of the option, -Wno-zerotrip, suppresses the
> warning. I have also added information of how to suppress the
> warning in the message.
>
> Alternatively, it is also possible to only activate the warning
> if it is set explicitly, or with -Wall. I can easily change the
> patch to do so, if that turns out to be the consensus (I have no
> strong opinion on the matter either way)
>
> Regression-tested. OK for trunk?
I'm never quite sure whether I like the ongoing inflation of warning
options, but this particular flag is one that I might find useful
myself on occasion. So: Ok for trunk from my side.
However, I would prefer to disable the warning by default, but include
it in -Wall.
Thanks for the patch ...
Cheers,
Janus
> 2013-08-03 Thomas Koenig <tkoenig@gcc.gnu.org>
>
> PR fortran/56666
> * gfortran.h (gfc_option_t): Add warn_zerotrip.
> * invoke.texi (-Wzerotrip): Document option.
> * lang.opt (Wzerotrip): Add.
> * options.c (gfc_init_options): Initialize warn_zerotrip.
> (gfc_handle_option): Handle OPT_Wzerotrip.
> * resolve.c (gfc_resolve_iterator): Honor
> gfc_option.warn_zerotrip; update error message to show
> how to suppress the warning.
>
> 2013-08-03 Thomas Koenig <tkoenig@gcc.gnu.org>
>
> PR fortran/56666
> * gfortran.dg/do_check_10.f90: New test.
More information about the Fortran
mailing list