From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5D9253857C7C; Thu, 13 Jan 2022 11:40:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D9253857C7C From: "egallager at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/103996] Provide Better diagnostic for invalid reuse of a function name Date: Thu, 13 Jan 2022 11:40:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: egallager at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: see_also cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2022 11:40:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103996 Eric Gallager changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D87656 CC| |egallager at gcc dot gnu.o= rg --- Comment #3 from Eric Gallager --- So, -Wshadow actually used to warn about this, but people didn't like it, so that part of -Wshadow got removed from GCC in 4.8: https://gcc.gnu.org/gcc-4.8/changes.html See also: https://lkml.org/lkml/2006/11/28/239 However, as of GCC 7, the -Wshadow flag now takes additional arguments (-Wshadow=3Dglobal, -Wshadow=3Dlocal, -Wshadow=3Dcompatible-local) to let u= sers be more specific about which shadowing warnings they want: https://gcc.gnu.org/gcc-7/changes.html=20 So, I'm wondering if the part of -Wshadow that got removed in 4.8 could get added back to it as a non-default argument to the flag? e.g. -Wshadow=3Dfun= ction And maybe the arguments to -Wshadow could become a comma-separated list, to= o, so users could do things like -Wshadow=3Dfunction,global or -Wshadow=3Dfunction,local or something (in bug 87656 I was thinking that a -Wshadow=3Dcompatible-global might make sense, too)=