From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 289643858D34; Wed, 21 Feb 2024 18:29:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 289643858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708540165; bh=kGjfR+t6TO959Y45FiEYmuU7KvUUgKjWn0Jk9DscXF0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=V2/HBUxCaSJ5oBLD7V874rYWiYCCE9ZL3qa44wqN7jBV9MlW3XjcM8v7z0FlWMIvp 1iJ5GhFG0uJ1qmgdKmsz3Y8Wy23yncKEqOLJfu2E3zuhC9pgN26rJasNDP9AG2xvgI AO9SdxhaWMQA4xHOMiRCHV7glLecrwgnszRphvAE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/114007] gcc chokes on __has_cpp_attribute(clang::unsafe_buffer_usage) Date: Wed, 21 Feb 2024 18:29:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status attachments.created 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=3D114007 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gn= u.org Status|NEW |ASSIGNED --- Comment #17 from Jakub Jelinek --- Created attachment 57483 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57483&action=3Dedit gcc14-pr114007.patch So far very lightly tested fix. The FEs only use 8-bit flags on tokens unlike libcpp, so we are fairly tigh= t on the bits there, fortunately PURE_ZERO is only used by C++ FE (though, set f= or both C/C++) and additionally only on CPP_NUMBERs, so reusing the same bit on CPP_COLON tokens in C FE + libcpp only (and only before C23 in strict modes= ) is I think fine. Still, the JOIN2(:,:) case works in C23 or GNU modes but not in the old mod= es, but that is because it is a preprocessor error, trying to paste tokens into something which is not a valid preprocessing token. I'm not afraid people would try to use that widely if they want < C23 compatibility of attributes= .=