From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A87BF385734C; Fri, 23 Sep 2022 14:24:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A87BF385734C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663943076; bh=Yo8FCtkVGUqmzjKPkeETtwHCH9vsQ1WnajMIahpqx7w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xub5F094b6ZkROc9YLw7rODjKoAEzIP85DsZM84VG/nz51Jvz5ScpIcsQ9jMVGVv7 fGYhtFGe9vIuefMcFJ7XoIbXSfvnH7qc4kG5YyPlj2l+qYnhKk01+9TryI4jDV60A4 jTZUZ4/DHSQMMgSO87dSRYqiN4iamLDObhJQE0GE= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/51437] GCC should warn on the use of reserved identifier/macro names Date: Fri, 23 Sep 2022 14:24:34 +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: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D51437 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |redi at gcc dot gnu.org --- Comment #17 from Jonathan Wakely --- (In reply to Josh Triplett from comment #5) > I'd like to see this as well. While issuing such a warning by default wo= uld > cause numerous warnings with existing code, having it as an opt-in > -Wreserved-identifiers would help greatly. Clang does this now, with -Wreserved-identifier (N.B. singular, not "identifiers") > Also, the rules for C prohibit a leading underscore followed by a capital > letter, or two adjacent underscores *anywhere* in the identifier. So, for > example, this__identifier, or_this_identifier__. No, that's only in C++. C allows two adjacent underscores anywhere except t= he start. C++ does not.=