From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E9FD4385700F; Tue, 16 May 2023 20:08:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9FD4385700F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684267718; bh=9peIZZyLnyFu3q2Bb3dCPz6+AOXwtrbpkc0Kzw1ree8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vie4bRHUAeBlbLDM7dCsllJLk6QrzvB505lQFLWCrj8jfGpMRhobz4yjngem/wjIl bnbMGZP99INEb1ayjgnYwcADWf9Tjrqdv569byDUoED2QnvDG4wo9C88eIWszeVnjQ GM+0Al34EAxE/Km0bTs21AcNfpQzSwYz/lhXleFI= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109877] Support for clang-style attributes is needed to parse Darwin SDK headers properly Date: Tue, 16 May 2023 20:08:38 +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: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: iains at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D109877 --- Comment #5 from Iain Sandoe --- (In reply to Jakub Jelinek from comment #4) > (In reply to Andrew Pinski from comment #2) > > This style of attributes is bad. Because the GNU style attribute is just > > token(expression,expression,expression) it seems odd that they added th= ese > > kind of attributes without thinking maybe it would be rejected somewhere > > else. >=20 > To be precise, some attributes have the first argument an identifier rath= er > than expression (e.g. mode/format/cleanup/access attribute). > So, the macOS as first argument is acceptable, but not the second one. As far as I can tell (and what my current implementation does) is to say th= at everything in the inner parentheses cam be lexed/parsed in a manner specifi= c to the attribute ID. so in: availability(zzzz) the zzzz is parsed specifically to "availability" and presumably: another_attr(yyyy) could have a different set of rules. As noted, we [at least, all I have spoken to] agree that this is bad (in respect of deviating from GNU style without any other mechanism to differentiate). However, once stuff is in the wild....=