On 07/07/2016 05:53 PM, Tobias Burnus wrote: > On Thu, Jul 07, 2016 at 02:13:12PM +0200, Tobias Burnus wrote: >> marxin wrote: >>> gcc/fortran/ChangeLog: >>> >>> 2016-07-01 Martin Liska <mli...@suse.cz> >>> * lang.opt (Wundefined-do-loop): New option. >>> * resolve.c (gfc_resolve_iterator): Warn for Wundefined-do-loop. >>> (gfc_trans_simple_do): Generate a c-style loop. >>> (gfc_trans_do): Fix GNU coding style. >> >> Can you also document the new warning in gcc/fortran/invoke.texi? >> >> Otherwise, this patch looks good to me. Thanks for working on it. > > > If I look at the commit to .opt, > > +Wundefined-do-loop > +Fortran Warning Var(warn_undefined_do_loop) LangEnabledBy(Fortran,Wall) > > and to .texi, > > +@item -Wundefined-do-loop > [...] > +Warn if a DO loop with step either 1 or -1 yields an underflow or an > overflow > +during iteration of an induction variable of the loop. Enabled by default. > > I think the "Enabled by default" is misleading as it is only enabled by -Wall, > i.e. I had expected something like: "This warning is enabled by > @option{-Wall}." > > Cheers, > > Tobias >
Thanks for the review, I'm going to install following patch. Martin
>From 5bfd6b5672a99952dac5aeb6c9a86a36affb0065 Mon Sep 17 00:00:00 2001 From: marxin <mli...@suse.cz> Date: Fri, 8 Jul 2016 10:36:44 +0200 Subject: [PATCH] Enhance documentation of Wundefined-do-loop gcc/fortran/ChangeLog: 2016-07-08 Martin Liska <mli...@suse.cz> * invoke.texi (Wundefined-do-loop): Enhance documentation. --- gcc/fortran/invoke.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index c0be1ab..87baf15 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -929,7 +929,8 @@ is active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003}, @opindex @code{Wundefined-do-loop} @cindex warnings, undefined do loop Warn if a DO loop with step either 1 or -1 yields an underflow or an overflow -during iteration of an induction variable of the loop. Enabled by default. +during iteration of an induction variable of the loop. +This option is implied by @option{-Wall}. @item -Wunderflow @opindex @code{Wunderflow} -- 2.8.4