options, '-Wc++[...]-extensions': Remove undefined one-argument 'LangEnabledBy' option properties (was: [PATCH] c++: Add new warning options for C++ language mismatches)

Message ID 87czi59khu.fsf@euler.schwinge.homeip.net
State Committed
Headers
Series options, '-Wc++[...]-extensions': Remove undefined one-argument 'LangEnabledBy' option properties (was: [PATCH] c++: Add new warning options for C++ language mismatches) |

Commit Message

Thomas Schwinge March 29, 2022, 9:27 a.m. UTC
  Hi!

On 2021-05-19T13:09:29-0400, Marek Polacek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> On Wed, May 19, 2021 at 05:59:34PM +0100, Jonathan Wakely wrote:
>> On 19/05/21 12:53 -0400, Marek Polacek wrote:
>> > On Wed, May 19, 2021 at 05:39:24PM +0100, Jonathan Wakely via Gcc-patches wrote:
>> > > --- a/gcc/c-family/c.opt
>> > > +++ b/gcc/c-family/c.opt

>> > > +Wc++11-extensions
>> > > +C++ ObjC++ Var(warn_cxx11_extensions) Warning LangEnabledBy(C++ ObjC++,Wall) Init(1)
>> > > +Warn about C++11 constructs in code compiled with an older standard.
>> > > +
>> > > +[Etc.]

>> > So these are enabled by -Wall but also turned on by default?  Let's choose one
>> > and then drop either the Init(1) or the LangEnabledBy(C++ ObjC++,Wall) part?
>>
>> Ah, good point. I mostly just cargo-cult what I see in that file (is
>> the format documented somewhere?)
>
> doc/options.texi I think.

Correct.

>> I think to preserve the current behaviour (using these constructs in
>> an unsupported dialect warns by default) we want them to be Init(1)
>> but not in -Wall. [...]

What you pushed in commit ee336ecb2a7161bc28f6c5343d97870a8d15e177
"c++: Add new warning options for C++ language mismatches" then had the
new options defined as follows; specifying 'LangEnabledBy(C++ ObjC++)'
instead of originally-posted 'LangEnabledBy(C++ ObjC++,Wall)':

| --- gcc/c-family/c.opt
| +++ gcc/c-family/c.opt
| [...]
| +Wc++11-extensions
| +C++ ObjC++ Var(warn_cxx11_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1)
| +Warn about C++11 constructs in code compiled with an older standard.
| +
| +[Etc.]

OK to push the attached "options, '-Wc++[...]-extensions':
Remove undefined one-argument 'LangEnabledBy' option properties"?


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
  

Comments

Jonathan Wakely March 29, 2022, 11:34 a.m. UTC | #1
On Tue, 29 Mar 2022 at 10:28, Thomas Schwinge wrote:
>
> Hi!
>
> On 2021-05-19T13:09:29-0400, Marek Polacek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > On Wed, May 19, 2021 at 05:59:34PM +0100, Jonathan Wakely wrote:
> >> On 19/05/21 12:53 -0400, Marek Polacek wrote:
> >> > On Wed, May 19, 2021 at 05:39:24PM +0100, Jonathan Wakely via Gcc-patches wrote:
> >> > > --- a/gcc/c-family/c.opt
> >> > > +++ b/gcc/c-family/c.opt
>
> >> > > +Wc++11-extensions
> >> > > +C++ ObjC++ Var(warn_cxx11_extensions) Warning LangEnabledBy(C++ ObjC++,Wall) Init(1)
> >> > > +Warn about C++11 constructs in code compiled with an older standard.
> >> > > +
> >> > > +[Etc.]
>
> >> > So these are enabled by -Wall but also turned on by default?  Let's choose one
> >> > and then drop either the Init(1) or the LangEnabledBy(C++ ObjC++,Wall) part?
> >>
> >> Ah, good point. I mostly just cargo-cult what I see in that file (is
> >> the format documented somewhere?)
> >
> > doc/options.texi I think.
>
> Correct.
>
> >> I think to preserve the current behaviour (using these constructs in
> >> an unsupported dialect warns by default) we want them to be Init(1)
> >> but not in -Wall. [...]
>
> What you pushed in commit ee336ecb2a7161bc28f6c5343d97870a8d15e177
> "c++: Add new warning options for C++ language mismatches" then had the
> new options defined as follows; specifying 'LangEnabledBy(C++ ObjC++)'
> instead of originally-posted 'LangEnabledBy(C++ ObjC++,Wall)':
>
> | --- gcc/c-family/c.opt
> | +++ gcc/c-family/c.opt
> | [...]
> | +Wc++11-extensions
> | +C++ ObjC++ Var(warn_cxx11_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1)
> | +Warn about C++11 constructs in code compiled with an older standard.
> | +
> | +[Etc.]
>
> OK to push the attached "options, '-Wc++[...]-extensions':
> Remove undefined one-argument 'LangEnabledBy' option properties"?

I can't approve it, but no objections from me.
  
Joseph Myers March 29, 2022, 6:13 p.m. UTC | #2
On Tue, 29 Mar 2022, Thomas Schwinge wrote:

> | --- gcc/c-family/c.opt
> | +++ gcc/c-family/c.opt
> | [...]
> | +Wc++11-extensions
> | +C++ ObjC++ Var(warn_cxx11_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1)
> | +Warn about C++11 constructs in code compiled with an older standard.
> | +
> | +[Etc.]
> 
> OK to push the attached "options, '-Wc++[...]-extensions':
> Remove undefined one-argument 'LangEnabledBy' option properties"?

OK.
  

Patch

From 78ee403f982526e0c026719c450dc5aead84accf Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Sat, 26 Mar 2022 22:21:14 +0100
Subject: [PATCH] options, '-Wc++[...]-extensions': Remove undefined
 one-argument 'LangEnabledBy' option properties

A one-argument form of the 'LangEnabledBy' option property isn't defined,
and effectively appears to be a no-op.  Removing these only changes
'build-gcc/gcc/optionlist' accordingly, but no other generated files.

Clean-up for commit ee336ecb2a7161bc28f6c5343d97870a8d15e177
"c++: Add new warning options for C++ language mismatches".

	gcc/c-family/
	* c.opt (Wc++11-extensions, Wc++14-extensions, Wc++17-extensions)
	(Wc++20-extensions, Wc++23-extensions): Remove 'LangEnabledBy'
	option properties.
---
 gcc/c-family/c.opt | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 1034a1b3946..07da40ef43b 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -459,23 +459,23 @@  C++ ObjC++ Var(warn_cxx20_compat) Warning LangEnabledBy(C++ ObjC++,Wall)
 Warn about C++ constructs whose meaning differs between ISO C++ 2017 and ISO C++ 2020.
 
 Wc++11-extensions
-C++ ObjC++ Var(warn_cxx11_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1)
+C++ ObjC++ Var(warn_cxx11_extensions) Warning Init(1)
 Warn about C++11 constructs in code compiled with an older standard.
 
 Wc++14-extensions
-C++ ObjC++ Var(warn_cxx14_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1)
+C++ ObjC++ Var(warn_cxx14_extensions) Warning Init(1)
 Warn about C++14 constructs in code compiled with an older standard.
 
 Wc++17-extensions
-C++ ObjC++ Var(warn_cxx17_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1)
+C++ ObjC++ Var(warn_cxx17_extensions) Warning Init(1)
 Warn about C++17 constructs in code compiled with an older standard.
 
 Wc++20-extensions
-C++ ObjC++ Var(warn_cxx20_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1)
+C++ ObjC++ Var(warn_cxx20_extensions) Warning Init(1)
 Warn about C++20 constructs in code compiled with an older standard.
 
 Wc++23-extensions
-C++ ObjC++ Var(warn_cxx23_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1)
+C++ ObjC++ Var(warn_cxx23_extensions) Warning Init(1)
 Warn about C++23 constructs in code compiled with an older standard.
 
 Wcast-function-type
-- 
2.25.1