This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, Fortran] Optionally suppress no-automatic overwrites recursive warning - for review
- From: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- To: Mark Eggleston <mark dot eggleston at codethink dot co dot uk>
- Cc: Tobias Burnus <tobias at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, fortran <fortran at gcc dot gnu dot org>, Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- Date: Fri, 20 Sep 2019 08:46:23 +0200
- Subject: Re: [PATCH, Fortran] Optionally suppress no-automatic overwrites recursive warning - for review
- References: <0ddfc9df-384a-98eb-f950-57705d1a5faf@codethink.co.uk> <b37e6276-0ef7-f8be-b675-1d401c48ea2d@codesourcery.com>
On Thu, 19 Sep 2019 17:46:29 +0200
Tobias Burnus <tobias@codesourcery.com> wrote:
> Hi Mark,
>
> On 9/19/19 3:40 PM, Mark Eggleston wrote:
> > The following warning is produced when -fno-automatic and -frecursive
> > are used at the same time:
> >
> > f951: Warning: Flag '-fno-automatic' overwrites '-frecursive'
> >
> > This patch allows the warning to be switched off using a new option,
> > -Woverwrite-recursive, initialised to on.
> >
> > I don't have a test case for this as I don't know how to test for a
> > warning that isn't related to a line of code.
>
> Try:
>
> ! { dg-warning "Flag .-fno-automatic. overwrites .-frecursive." "" {
> target *-*-* } 0 }
>
> The syntax is { dg-warning "message", "label" {target ...} linenumber },
> where linenumber = 0 means it can be on any line.
>
> If the output doesn't match (but I think it does with "Warning:"),
> general messages can be caught with "dg-message".
Also:
> @@ -411,7 +411,7 @@ gfc_post_options (const char **pfilename)
> && flag_max_stack_var_size != 0)
> gfc_warning_now (0, "Flag %<-fno-automatic%> overwrites %<-fmax-stack-var-size=%d%>",
> flag_max_stack_var_size);
> - else if (!flag_automatic && flag_recursive)
> + else if (!flag_automatic && flag_recursive && warn_overwrite_recursive)
> gfc_warning_now (0, "Flag %<-fno-automatic%> overwrites %<-frecursive%>");
> else if (!flag_automatic && flag_openmp)
> gfc_warning_now (0, "Flag %<-fno-automatic%> overwrites %<-frecursive%> implied by "
>
Doesn't look right to me. Do you want
gfc_warning_now (OPT_Woverwrite_recursive, "Flag ...
instead?
thanks,