public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Future warnings not treated as errors
@ 2019-03-19  2:48 Alex Henrie
  2019-03-19  2:48 ` [PATCH 2/2] PR c/65403 - Add tests for -Wno-error=<some-future-option> Alex Henrie
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Alex Henrie @ 2019-03-19  2:48 UTC (permalink / raw)
  To: gcc-patches, manu; +Cc: Alex Henrie

Hello,

I have received permission to contribute to GCC, but I do not have
commit access. Could one of you please merge these patches for me?

-Alex

Alex Henrie (1):
  PR c/65403 - Add tests for -Wno-error=<some-future-option>

Manuel López-Ibáñez (1):
  PR c/65403 - Ignore -Wno-error=<some-future-warning>

 gcc/opts-common.c                      |  2 ++
 gcc/opts-global.c                      | 10 +++++++---
 gcc/opts.c                             |  5 ++++-
 gcc/opts.h                             |  2 ++
 gcc/testsuite/c-c++-common/pr65403-1.c | 10 ++++++++++
 gcc/testsuite/c-c++-common/pr65403-2.c | 15 +++++++++++++++
 6 files changed, 40 insertions(+), 4 deletions(-)
 create mode 100644 gcc/testsuite/c-c++-common/pr65403-1.c
 create mode 100644 gcc/testsuite/c-c++-common/pr65403-2.c

-- 
2.21.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/2] PR c/65403 - Add tests for -Wno-error=<some-future-option>
  2019-03-19  2:48 [PATCH 0/2] Future warnings not treated as errors Alex Henrie
@ 2019-03-19  2:48 ` Alex Henrie
  2019-06-19 17:55   ` Jeff Law
  2019-03-19  7:21 ` [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning> Alex Henrie
  2019-03-19  9:27 ` [PATCH 0/2] Future warnings not treated as errors Martin Liška
  2 siblings, 1 reply; 14+ messages in thread
From: Alex Henrie @ 2019-03-19  2:48 UTC (permalink / raw)
  To: gcc-patches, manu; +Cc: Alex Henrie

---
 gcc/testsuite/c-c++-common/pr65403-1.c | 10 ++++++++++
 gcc/testsuite/c-c++-common/pr65403-2.c | 15 +++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 gcc/testsuite/c-c++-common/pr65403-1.c
 create mode 100644 gcc/testsuite/c-c++-common/pr65403-2.c

diff --git a/gcc/testsuite/c-c++-common/pr65403-1.c b/gcc/testsuite/c-c++-common/pr65403-1.c
new file mode 100644
index 00000000000..fbe004a1f78
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr65403-1.c
@@ -0,0 +1,10 @@
+/* PR c/65403 */
+/* Test an unrecognized -Wno-error option in the absence of any other
+   diagnostics. The -Wno-error option should be ignored. */
+
+/* { dg-options "-Werror -Wno-error=some-future-warning" } */
+
+int main(int argc, char **argv)
+{
+  return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr65403-2.c b/gcc/testsuite/c-c++-common/pr65403-2.c
new file mode 100644
index 00000000000..128d4f694a6
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr65403-2.c
@@ -0,0 +1,15 @@
+/* PR c/65403 */
+/* Test a warning, treated as an error, that some future -Wno-error option
+   might downgrade back to a warning. The -Wno-error option should produce a
+   warning in this case. */
+
+/* { dg-options "-Wunused-variable -Werror -Wno-error=some-future-warning" } */
+
+int main(int argc, char **argv)
+{
+  int foo; /* { dg-error "unused variable 'foo'" } */
+  return 0;
+}
+
+/* { dg-error "no option -Wsome-future-warning" "" { target *-*-* } 0 } */
+/* { dg-message "all warnings being treated as errors" "" { target *-*-* } 0 } */
-- 
2.21.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning>
  2019-03-19  2:48 [PATCH 0/2] Future warnings not treated as errors Alex Henrie
  2019-03-19  2:48 ` [PATCH 2/2] PR c/65403 - Add tests for -Wno-error=<some-future-option> Alex Henrie
@ 2019-03-19  7:21 ` Alex Henrie
  2019-03-19 17:41   ` Martin Sebor
  2019-06-19 17:52   ` Jeff Law
  2019-03-19  9:27 ` [PATCH 0/2] Future warnings not treated as errors Martin Liška
  2 siblings, 2 replies; 14+ messages in thread
From: Alex Henrie @ 2019-03-19  7:21 UTC (permalink / raw)
  To: gcc-patches, manu

From: Manuel López-Ibáñez <manu@gcc.gnu.org>

* opts.c: Ignore -Wno-error=<some-future-warning> except if there are
other diagnostics.
---
 gcc/opts-common.c |  2 ++
 gcc/opts-global.c | 10 +++++++---
 gcc/opts.c        |  5 ++++-
 gcc/opts.h        |  2 ++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index edbb3ac9b6d..36e06e2372a 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -26,6 +26,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic.h"
 #include "spellcheck.h"
 
+vec<const char *> ignored_wnoerror_options;
+
 static void prune_options (struct cl_decoded_option **, unsigned int *);
 
 /* An option that is undocumented, that takes a joined argument, and
diff --git a/gcc/opts-global.c b/gcc/opts-global.c
index a5e9ef0237a..0b2550a4855 100644
--- a/gcc/opts-global.c
+++ b/gcc/opts-global.c
@@ -132,12 +132,16 @@ print_ignored_options (void)
 {
   while (!ignored_options.is_empty ())
     {
-      const char *opt;
-
-      opt = ignored_options.pop ();
+      const char * opt = ignored_options.pop ();
       warning_at (UNKNOWN_LOCATION, 0,
 		  "unrecognized command line option %qs", opt);
     }
+  while (!ignored_wnoerror_options.is_empty ())
+    {
+      const char * opt = ignored_wnoerror_options.pop ();
+      warning_at (UNKNOWN_LOCATION, 0,
+		  "-Wno-error=%s: no option -W%s", opt, opt);
+    }
 }
 
 /* Handle an unknown option DECODED, returning true if an error should
diff --git a/gcc/opts.c b/gcc/opts.c
index 3161e0b6753..4fa79306e30 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -3079,7 +3079,10 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
   strcpy (new_option + 1, arg);
   option_index = find_opt (new_option, lang_mask);
   if (option_index == OPT_SPECIAL_unknown)
-    error_at (loc, "%<-Werror=%s%>: no option -%s", arg, new_option);
+    if (value)
+      error_at (loc, "%<-Werror=%s%>: no option -%s", arg, new_option);
+    else
+      ignored_wnoerror_options.safe_push (arg);
   else if (!(cl_options[option_index].flags & CL_WARNING))
     error_at (loc, "%<-Werror=%s%>: -%s is not an option that controls "
 	      "warnings", arg, new_option);
diff --git a/gcc/opts.h b/gcc/opts.h
index f14d9bcb896..b18504e0bc3 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -456,4 +456,6 @@ extern bool parse_and_check_align_values (const char *flag,
 					  bool report_error,
 					  location_t loc);
 
+extern vec<const char *> ignored_wnoerror_options;
+
 #endif
-- 
2.21.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/2] Future warnings not treated as errors
  2019-03-19  2:48 [PATCH 0/2] Future warnings not treated as errors Alex Henrie
  2019-03-19  2:48 ` [PATCH 2/2] PR c/65403 - Add tests for -Wno-error=<some-future-option> Alex Henrie
  2019-03-19  7:21 ` [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning> Alex Henrie
@ 2019-03-19  9:27 ` Martin Liška
  2019-03-19 15:00   ` Joseph Myers
  2019-03-19 16:56   ` Alex Henrie
  2 siblings, 2 replies; 14+ messages in thread
From: Martin Liška @ 2019-03-19  9:27 UTC (permalink / raw)
  To: Alex Henrie, gcc-patches, manu; +Cc: Joseph Myers

On 3/19/19 3:46 AM, Alex Henrie wrote:
> Hello,
> 
> I have received permission to contribute to GCC, but I do not have
> commit access. Could one of you please merge these patches for me?

Hi.

I can do it for you. But if I see correctly, Joseph M. had some concerns
and he should probably make final patch approval.

Martin

> 
> -Alex
> 
> Alex Henrie (1):
>   PR c/65403 - Add tests for -Wno-error=<some-future-option>
> 
> Manuel López-Ibáñez (1):
>   PR c/65403 - Ignore -Wno-error=<some-future-warning>
> 
>  gcc/opts-common.c                      |  2 ++
>  gcc/opts-global.c                      | 10 +++++++---
>  gcc/opts.c                             |  5 ++++-
>  gcc/opts.h                             |  2 ++
>  gcc/testsuite/c-c++-common/pr65403-1.c | 10 ++++++++++
>  gcc/testsuite/c-c++-common/pr65403-2.c | 15 +++++++++++++++
>  6 files changed, 40 insertions(+), 4 deletions(-)
>  create mode 100644 gcc/testsuite/c-c++-common/pr65403-1.c
>  create mode 100644 gcc/testsuite/c-c++-common/pr65403-2.c
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/2] Future warnings not treated as errors
  2019-03-19  9:27 ` [PATCH 0/2] Future warnings not treated as errors Martin Liška
@ 2019-03-19 15:00   ` Joseph Myers
  2019-03-19 16:56   ` Alex Henrie
  1 sibling, 0 replies; 14+ messages in thread
From: Joseph Myers @ 2019-03-19 15:00 UTC (permalink / raw)
  To: Martin Liška; +Cc: Alex Henrie, gcc-patches, manu

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]

On Tue, 19 Mar 2019, Martin Liška wrote:

> On 3/19/19 3:46 AM, Alex Henrie wrote:
> > Hello,
> > 
> > I have received permission to contribute to GCC, but I do not have
> > commit access. Could one of you please merge these patches for me?
> 
> Hi.
> 
> I can do it for you. But if I see correctly, Joseph M. had some concerns
> and he should probably make final patch approval.

I've noted to look at this patch during development stage 1.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/2] Future warnings not treated as errors
  2019-03-19  9:27 ` [PATCH 0/2] Future warnings not treated as errors Martin Liška
  2019-03-19 15:00   ` Joseph Myers
@ 2019-03-19 16:56   ` Alex Henrie
  2019-03-19 17:08     ` Martin Liška
  1 sibling, 1 reply; 14+ messages in thread
From: Alex Henrie @ 2019-03-19 16:56 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches, manu, Joseph Myers

On Tue, Mar 19, 2019 at 3:19 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 3/19/19 3:46 AM, Alex Henrie wrote:
> > Hello,
> >
> > I have received permission to contribute to GCC, but I do not have
> > commit access. Could one of you please merge these patches for me?
>
> Hi.
>
> I can do it for you. But if I see correctly, Joseph M. had some concerns
> and he should probably make final patch approval.

If I understand correctly, Joseph wanted an error message to still be
printed if other diagnostics are also printed, the same as how
-Wno-<some-future-warning> works. The patches that I sent yesterday do
exactly that.

-Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/2] Future warnings not treated as errors
  2019-03-19 16:56   ` Alex Henrie
@ 2019-03-19 17:08     ` Martin Liška
  2019-03-20  8:27       ` Alex Henrie
  0 siblings, 1 reply; 14+ messages in thread
From: Martin Liška @ 2019-03-19 17:08 UTC (permalink / raw)
  To: Alex Henrie; +Cc: gcc-patches, manu, Joseph Myers

On 3/19/19 5:35 PM, Alex Henrie wrote:
> On Tue, Mar 19, 2019 at 3:19 AM Martin Liška <mliska@suse.cz> wrote:
>>
>> On 3/19/19 3:46 AM, Alex Henrie wrote:
>>> Hello,
>>>
>>> I have received permission to contribute to GCC, but I do not have
>>> commit access. Could one of you please merge these patches for me?
>>
>> Hi.
>>
>> I can do it for you. But if I see correctly, Joseph M. had some concerns
>> and he should probably make final patch approval.
> 
> If I understand correctly, Joseph wanted an error message to still be
> printed if other diagnostics are also printed, the same as how
> -Wno-<some-future-warning> works. The patches that I sent yesterday do
> exactly that.
> 
> -Alex
> 

Hi.

What's Joseph telling is that right now the patch can't be approved (and installed).
It's due to fact that we are close to the release in stage4:
https://www.gnu.org/software/gcc/develop.html#stage4

So that a proper review will happen in couple of weeks.

Thanks for understanding,
Martin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning>
  2019-03-19  7:21 ` [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning> Alex Henrie
@ 2019-03-19 17:41   ` Martin Sebor
  2019-03-20  4:08     ` Alex Henrie
  2019-06-19 17:52   ` Jeff Law
  1 sibling, 1 reply; 14+ messages in thread
From: Martin Sebor @ 2019-03-19 17:41 UTC (permalink / raw)
  To: Alex Henrie, gcc-patches, manu

On 3/18/19 8:46 PM, Alex Henrie wrote:
> From: Manuel López-Ibáñez <manu@gcc.gnu.org>
> 
> * opts.c: Ignore -Wno-error=<some-future-warning> except if there are
> other diagnostics.
> ---
>   gcc/opts-common.c |  2 ++
>   gcc/opts-global.c | 10 +++++++---
>   gcc/opts.c        |  5 ++++-
>   gcc/opts.h        |  2 ++
>   4 files changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/opts-common.c b/gcc/opts-common.c
> index edbb3ac9b6d..36e06e2372a 100644
> --- a/gcc/opts-common.c
> +++ b/gcc/opts-common.c
> @@ -26,6 +26,8 @@ along with GCC; see the file COPYING3.  If not see
>   #include "diagnostic.h"
>   #include "spellcheck.h"
>   
> +vec<const char *> ignored_wnoerror_options;
> +
>   static void prune_options (struct cl_decoded_option **, unsigned int *);
>   
>   /* An option that is undocumented, that takes a joined argument, and
> diff --git a/gcc/opts-global.c b/gcc/opts-global.c
> index a5e9ef0237a..0b2550a4855 100644
> --- a/gcc/opts-global.c
> +++ b/gcc/opts-global.c
> @@ -132,12 +132,16 @@ print_ignored_options (void)
>   {
>     while (!ignored_options.is_empty ())
>       {
> -      const char *opt;
> -
> -      opt = ignored_options.pop ();
> +      const char * opt = ignored_options.pop ();
>         warning_at (UNKNOWN_LOCATION, 0,
>   		  "unrecognized command line option %qs", opt);
>       }
> +  while (!ignored_wnoerror_options.is_empty ())
> +    {
> +      const char * opt = ignored_wnoerror_options.pop ();
> +      warning_at (UNKNOWN_LOCATION, 0,
> +		  "-Wno-error=%s: no option -W%s", opt, opt);

Please remember to quote the command line options in the message
(same as in the error below):

> +    }
>   }
>   
>   /* Handle an unknown option DECODED, returning true if an error should
> diff --git a/gcc/opts.c b/gcc/opts.c
> index 3161e0b6753..4fa79306e30 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -3079,7 +3079,10 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
>     strcpy (new_option + 1, arg);
>     option_index = find_opt (new_option, lang_mask);
>     if (option_index == OPT_SPECIAL_unknown)
> -    error_at (loc, "%<-Werror=%s%>: no option -%s", arg, new_option);
> +    if (value)
> +      error_at (loc, "%<-Werror=%s%>: no option -%s", arg, new_option);
                          ^^^^^^^^^^^^^^

Like that.

Thanks
Martin


> +    else
> +      ignored_wnoerror_options.safe_push (arg);
>     else if (!(cl_options[option_index].flags & CL_WARNING))
>       error_at (loc, "%<-Werror=%s%>: -%s is not an option that controls "
>   	      "warnings", arg, new_option);
> diff --git a/gcc/opts.h b/gcc/opts.h
> index f14d9bcb896..b18504e0bc3 100644
> --- a/gcc/opts.h
> +++ b/gcc/opts.h
> @@ -456,4 +456,6 @@ extern bool parse_and_check_align_values (const char *flag,
>   					  bool report_error,
>   					  location_t loc);
>   
> +extern vec<const char *> ignored_wnoerror_options;
> +
>   #endif
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning>
  2019-03-19 17:41   ` Martin Sebor
@ 2019-03-20  4:08     ` Alex Henrie
  0 siblings, 0 replies; 14+ messages in thread
From: Alex Henrie @ 2019-03-20  4:08 UTC (permalink / raw)
  To: Martin Sebor; +Cc: gcc-patches, manu

On Tue, Mar 19, 2019 at 11:26 AM Martin Sebor <msebor@gmail.com> wrote:
>
> Please remember to quote the command line options in the message
> (same as in the error below):

I'll send a new version. Thanks for the feedback!

-Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/2] Future warnings not treated as errors
  2019-03-19 17:08     ` Martin Liška
@ 2019-03-20  8:27       ` Alex Henrie
  2019-05-14  5:26         ` Alex Henrie
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Henrie @ 2019-03-20  8:27 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches, manu, Joseph Myers

On Tue, Mar 19, 2019 at 11:03 AM Martin Liška <mliska@suse.cz> wrote:
>
> What's Joseph telling is that right now the patch can't be approved (and installed).
> It's due to fact that we are close to the release in stage4:
> https://www.gnu.org/software/gcc/develop.html#stage4
>
> So that a proper review will happen in couple of weeks.
>
> Thanks for understanding,

Sure. I look forward to hearing back from you guys in a couple of weeks.

-Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/2] Future warnings not treated as errors
  2019-03-20  8:27       ` Alex Henrie
@ 2019-05-14  5:26         ` Alex Henrie
  0 siblings, 0 replies; 14+ messages in thread
From: Alex Henrie @ 2019-05-14  5:26 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches, manu, Joseph Myers

On Tue, Mar 19, 2019 at 10:09 PM Alex Henrie <alexhenrie24@gmail.com> wrote:
>
> On Tue, Mar 19, 2019 at 11:03 AM Martin Liška <mliska@suse.cz> wrote:
> >
> > What's Joseph telling is that right now the patch can't be approved (and installed).
> > It's due to fact that we are close to the release in stage4:
> > https://www.gnu.org/software/gcc/develop.html#stage4
> >
> > So that a proper review will happen in couple of weeks.
> >
> > Thanks for understanding,
>
> Sure. I look forward to hearing back from you guys in a couple of weeks.

Now that GCC 9.1 has been released, would you please merge these two patches?

-Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning>
  2019-03-19  7:21 ` [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning> Alex Henrie
  2019-03-19 17:41   ` Martin Sebor
@ 2019-06-19 17:52   ` Jeff Law
  2019-06-26  2:04     ` Alex Henrie
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff Law @ 2019-06-19 17:52 UTC (permalink / raw)
  To: Alex Henrie, gcc-patches, manu

On 3/18/19 8:46 PM, Alex Henrie wrote:
> From: Manuel López-Ibáñez <manu@gcc.gnu.org>
> 
> * opts.c: Ignore -Wno-error=<some-future-warning> except if there are
> other diagnostics.
That's not a complete ChangeLog entry.  Each file/function changed
should be mentioned.  Something like this:

	* opts-common.c (ignored_wnoerror_options): New global variable.
	* opts-global.c (print_ignored_options): Ignore
	-Wno-error=<some-future-warning> except if there are other
	diagnostics.
	* opts.c (enable_warning_as_error): Record ignored -Wno-error
	options.
	opts.h (ignored_wnoerror_options): Declare.

> diff --git a/gcc/opts.c b/gcc/opts.c
> index 3161e0b6753..4fa79306e30 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -3079,7 +3079,10 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
>    strcpy (new_option + 1, arg);
>    option_index = find_opt (new_option, lang_mask);
>    if (option_index == OPT_SPECIAL_unknown)
> -    error_at (loc, "%<-Werror=%s%>: no option -%s", arg, new_option);
> +    if (value)
> +      error_at (loc, "%<-Werror=%s%>: no option -%s", arg, new_option);
> +    else
> +      ignored_wnoerror_options.safe_push (arg);
>    else if (!(cl_options[option_index].flags & CL_WARNING))
>      error_at (loc, "%<-Werror=%s%>: -%s is not an option that controls "
>  	      "warnings", arg, new_option);
This hunk is my only concern with the patch.  In particular how is this
going to interact with the hints/suggestions we emit when we see an
unknown option?

The code on the trunk looks like this now:

>   if (option_index == OPT_SPECIAL_unknown)
>     {
>       option_proposer op;
>       const char *hint = op.suggest_option (new_option);
>       if (hint)
>         error_at (loc, "%<-W%serror=%s%>: no option %<-%s%>;"
>                   " did you mean %<-%s%>?", value ? "" : "no-",
>                   arg, new_option, hint);
>       else
>         error_at (loc, "%<-W%serror=%s%>: no option %<-%s%>",
>                   value ? "" : "no-", arg, new_option);
>     }
If HINT is set, do we still want to potentially push the argument onto
the ignored_wnoerror_options list?  My inclination is yes since the hint
is just that, a fuzzily matched hint.  That hint may be appropriate
(user typo'd or somesuch) or it may be totally offbase (user was trying
to turn off some future warning.

I'm open to other opinions here.

jeff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/2] PR c/65403 - Add tests for -Wno-error=<some-future-option>
  2019-03-19  2:48 ` [PATCH 2/2] PR c/65403 - Add tests for -Wno-error=<some-future-option> Alex Henrie
@ 2019-06-19 17:55   ` Jeff Law
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff Law @ 2019-06-19 17:55 UTC (permalink / raw)
  To: Alex Henrie, gcc-patches, manu

On 3/18/19 8:46 PM, Alex Henrie wrote:
> ---
>  gcc/testsuite/c-c++-common/pr65403-1.c | 10 ++++++++++
>  gcc/testsuite/c-c++-common/pr65403-2.c | 15 +++++++++++++++
>  2 files changed, 25 insertions(+)
>  create mode 100644 gcc/testsuite/c-c++-common/pr65403-1.c
>  create mode 100644 gcc/testsuite/c-c++-common/pr65403-2.c
This needs a ChangeLog entry.  It could be as simple as:

	* c-c++-common/pr65403-1.c: New test.
	* c-c++-common/pr65403-2.c: New test.

No inherent problems with the test, though I think we need to verify
they still do the right thing given the hints the compiler will try to
emit on unknown options now.  That's easy enough to do once we have
concluded on what the behvior should be now that the compiler emits
hints for unknown options.

Jeff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning>
  2019-06-19 17:52   ` Jeff Law
@ 2019-06-26  2:04     ` Alex Henrie
  0 siblings, 0 replies; 14+ messages in thread
From: Alex Henrie @ 2019-06-26  2:04 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches, manu

On Wed, Jun 19, 2019 at 11:52 AM Jeff Law <law@redhat.com> wrote:
>
> On 3/18/19 8:46 PM, Alex Henrie wrote:
> > From: Manuel López-Ibáñez <manu@gcc.gnu.org>
> >
> > * opts.c: Ignore -Wno-error=<some-future-warning> except if there are
> > other diagnostics.
> That's not a complete ChangeLog entry.  Each file/function changed
> should be mentioned.  Something like this:
>
>         * opts-common.c (ignored_wnoerror_options): New global variable.
>         * opts-global.c (print_ignored_options): Ignore
>         -Wno-error=<some-future-warning> except if there are other
>         diagnostics.
>         * opts.c (enable_warning_as_error): Record ignored -Wno-error
>         options.
>         opts.h (ignored_wnoerror_options): Declare.

Thanks!

> If HINT is set, do we still want to potentially push the argument onto
> the ignored_wnoerror_options list?  My inclination is yes since the hint
> is just that, a fuzzily matched hint.  That hint may be appropriate
> (user typo'd or somesuch) or it may be totally offbase (user was trying
> to turn off some future warning.

I don't think we need to support hints in the case of
-Wno-error=<some-unknown-warning> because we don't support hints for
-Wno-<some-unknown-warning> and as you pointed out, hints are less
likely to be helpful here because the warning may be perfectly valid
in a newer version of GCC.

I'll send rebased patches later tonight. Thanks for the feedback!

-Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-06-26  2:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19  2:48 [PATCH 0/2] Future warnings not treated as errors Alex Henrie
2019-03-19  2:48 ` [PATCH 2/2] PR c/65403 - Add tests for -Wno-error=<some-future-option> Alex Henrie
2019-06-19 17:55   ` Jeff Law
2019-03-19  7:21 ` [PATCH 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning> Alex Henrie
2019-03-19 17:41   ` Martin Sebor
2019-03-20  4:08     ` Alex Henrie
2019-06-19 17:52   ` Jeff Law
2019-06-26  2:04     ` Alex Henrie
2019-03-19  9:27 ` [PATCH 0/2] Future warnings not treated as errors Martin Liška
2019-03-19 15:00   ` Joseph Myers
2019-03-19 16:56   ` Alex Henrie
2019-03-19 17:08     ` Martin Liška
2019-03-20  8:27       ` Alex Henrie
2019-05-14  5:26         ` Alex Henrie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).