public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Why don't recently added -Wexceptions and -Winvalid-imported-macros use "Warning" flag?
@ 2021-05-13 21:33 Vadim Zeitlin
  2021-05-14  9:42 ` Martin Liška
  0 siblings, 1 reply; 2+ messages in thread
From: Vadim Zeitlin @ 2021-05-13 21:33 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: TEXT/PLAIN, Size: 627 bytes --]

 Hello,

 While running my script[1] parsing gcc/c-family/c.opt to extract
information about the new warnings for C++ programs, I've noticed that a
couple of new warnings in gcc 11 don't use the "Warning" flag which, I had
assumed, would be used for all warnings (with a couple of historical
exceptions). Was this assumption wrong, or could this have been an
oversight, i.e. should this flag be added to these warning too?

 For the reference, the commits adding the warning were:

- 1d87302a8e2 (c++: Add -Wexceptions warning option [PR97675], 2020-11-03)
- 10ee6da64c5 (C++ Module options, 2020-12-01)

 Thanks in advance,
VZ

[-- Attachment #2: Type: APPLICATION/PGP-SIGNATURE, Size: 196 bytes --]

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

* Re: Why don't recently added -Wexceptions and -Winvalid-imported-macros use "Warning" flag?
  2021-05-13 21:33 Why don't recently added -Wexceptions and -Winvalid-imported-macros use "Warning" flag? Vadim Zeitlin
@ 2021-05-14  9:42 ` Martin Liška
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liška @ 2021-05-14  9:42 UTC (permalink / raw)
  To: Vadim Zeitlin, gcc; +Cc: GCC Patches

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

On 5/13/21 11:33 PM, Vadim Zeitlin wrote:
>   Hello,
> 
>   While running my script[1] parsing gcc/c-family/c.opt to extract
> information about the new warnings for C++ programs, I've noticed that a
> couple of new warnings in gcc 11 don't use the "Warning" flag which, I had
> assumed, would be used for all warnings (with a couple of historical
> exceptions). Was this assumption wrong, or could this have been an
> oversight, i.e. should this flag be added to these warning too?
> 
>   For the reference, the commits adding the warning were:
> 
> - 1d87302a8e2 (c++: Add -Wexceptions warning option [PR97675], 2020-11-03)
> - 10ee6da64c5 (C++ Module options, 2020-12-01)
> 
>   Thanks in advance,
> VZ
> 

You are right, thanks for heads up. I'm going to install the following obvious patch
(and will add it to gcc-11 branch as well).

Martin

[-- Attachment #2: 0001-opts-add-Warning-keyword-for-2-options.patch --]
[-- Type: text/x-patch, Size: 1202 bytes --]

From 3d4ba1b4f34d16b98d6333d203c80b50f655d445 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Fri, 14 May 2021 11:40:58 +0200
Subject: [PATCH] opts: add Warning keyword for 2 options

gcc/c-family/ChangeLog:

	* c.opt: Add Warning keyword for 2 options.
---
 gcc/c-family/c.opt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index f1b4c3f34ec..5fcf961fd96 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -592,7 +592,7 @@ C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
 This switch is deprecated; use -Werror=implicit-function-declaration instead.
 
 Wexceptions
-C++ ObjC++ Var(warn_exceptions) Init(1)
+C++ ObjC++ Var(warn_exceptions) Init(1) Warning
 Warn when an exception handler is shadowed by another handler.
 
 Wextra
@@ -1741,7 +1741,7 @@ C++ ObjC Var(flag_module_version_ignore) Integer
 ; undocumented, Very dangerous, but occasionally useful
 
 Winvalid-imported-macros
-C++ ObjC++ Var(warn_imported_macros)
+C++ ObjC++ Var(warn_imported_macros) Warning
 Warn about macros that have conflicting header units definitions.
 
 flang-info-include-translate
-- 
2.31.1


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

end of thread, other threads:[~2021-05-14  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 21:33 Why don't recently added -Wexceptions and -Winvalid-imported-macros use "Warning" flag? Vadim Zeitlin
2021-05-14  9:42 ` Martin Liška

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).