From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 96E713858D34; Thu, 22 Feb 2024 10:31:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96E713858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708597884; bh=BNujjPUFiDWDXeZsjJHA4sD+m41D6Z5QSgVW51GwiIQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TJ0SDXmx6TNvJneYjFyFq6wiOIT2AAhk8Rn+uWSgU+zkd2wJTmodI+hT1ZCaeqHo1 /XOQRXhZRzWXHQxW6tKFmdub8DofeoL5b/WAFq20eYLXf78w1GuxiNeOs92d/Due1B Ho1sKg4yn8hMBkvFP3nyoYvh+KFzWjThrIjwhKBc= From: "ro at CeBiTec dot Uni-Bielefeld.DE" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/114007] gcc chokes on __has_cpp_attribute(clang::unsafe_buffer_usage) Date: Thu, 22 Feb 2024 10:31:23 +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: ro at CeBiTec dot Uni-Bielefeld.DE 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: 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 --- Comment #25 from ro at CeBiTec dot Uni-Bielefeld.DE --- > --- Comment #24 from Jakub Jelinek --- > (In reply to fxcoudert@gmail.com from comment #19) >> I haven=E2=80=99t yet tested Xcode 13.3 myself, and have only followed t= he PRs from >> far away. Are there any issues (SDK, linker, or otherwise) that we need = to >> report to Apple? Or that are already reported but we want taken more >> seriously? > > Do they use [[clang::unsafe_buffer_usage]] then if __has_safe_buffers is > defined > even in -std=3Dc11 etc. modes in the headers? they do AFAICS: their has no provision for different C std versions (except the obvious like not using restrict before C99). The section in question is #if __has_cpp_attribute(clang::unsafe_buffer_usage) #define __has_safe_buffers 1 #define __unsafe_buffer_usage [[clang::unsafe_buffer_usage]] #elif __has_attribute(unsafe_buffer_usage) #define __has_safe_buffers 1 #define __unsafe_buffer_usage __attribute__((__unsafe_buffer_usage__)) #else #define __has_safe_buffers 0 #define __unsafe_buffer_usage #endif with a long comment explaining the use with clang -Wunsafe-buffer-usage.=