From nobody Sun Aug 06 21:28:06 2023 X-Original-To: standards@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RJsxf6p9Lz4mRwl for ; Sun, 6 Aug 2023 21:28:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RJsxf5l2Wz3BrS for ; Sun, 6 Aug 2023 21:28:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691357286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FjH9EjLV1PEgxnoxVcjDGzrQOuzvYSh2Rbdyevf718I=; b=Xo2QF9Po4Y4b8zH1ymjTyIqwNPYJzgazxGJUWP1w0JEgdTuvZAniuFsicDyQz4lGmYDmFC ncfZwT5lfMjXSMwsbopUChC3957Jt2bOuyKqZLyZzrl2OAa5txKrNvO++TV/KvScq0yUkt OOnJyjkSLEkU61TSgoWTq6HupB/wvFl1McZEurOuJ+87IP25tFH3OIx61yWX91sn19jcbZ Qu9NK/3KWxPOYIGZS6WDFEsuhcHH7si8powxgUHmT2AVPXHf2kZ0l3p6kc+N5KSA+fZMC9 yx41b8kIy3QGmvoQLF/hrmR2bQRi9EQWGtVK55yVwVXKpZwOlUEDQXjJf7a8lA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691357286; a=rsa-sha256; cv=none; b=vY2GgXHjEffo6C+By0xpddX6k8AxxbMk7xWS0qzvwbJzhSMz14tvWvKGMT7p7vSWA97LFB c7wESEUxbLPr+cDScfD06FihufThmM6GZOhmNFEZrPaJ/T7bT8eUUXrrDdxllWliwGLCyW X1GjmmjgG4w/WRdRbz0PkRBBPNOWsCa2QInBC4z4xgZqTS80t6q7eCbewcxJhdCAxVP2dX d+VRuERloQ4767payhnNYDRt+Ez09hKyho5tlHdwhAQQuGshMu175YEAsssdDYOrk7KD+W gSkKNOjtA+lcsSM4gdTOxmWLxg8xoHcfM+xQ7lyTSLX2I4mJh9mZePy1SPXyBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RJsxf4V3BzB1s for ; Sun, 6 Aug 2023 21:28:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 376LS6hr031764 for ; Sun, 6 Aug 2023 21:28:06 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 376LS6vo031763 for standards@FreeBSD.org; Sun, 6 Aug 2023 21:28:06 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 272723] header breaks restricted pointers in C++ Date: Sun, 06 Aug 2023 21:28:06 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: standards@FreeBSD.org 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: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272723 --- Comment #1 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D15876d9fd83fdfa7d541ea747eb40faea= de975d2 commit 15876d9fd83fdfa7d541ea747eb40faeade975d2 Author: Sebastian Huber AuthorDate: 2023-08-06 13:27:27 +0000 Commit: Konstantin Belousov CommitDate: 2023-08-06 21:09:52 +0000 sys/cdefs.h: fix for use __restrict in C++ Newlib shares large parts of with FreeBSD and received this bug report: https://sourceware.org/pipermail/newlib/2023/020400.html As an extension, GCC and clang offer C99-style restricted pointers in C++ mode: https://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html We notice that this extension is broken when including newlib headers: restricted pointers are treated as ordinary pointers. We traced this to the following section of newlib/libc/include/sys/cdefs.h: /* * GCC 2.95 provides `__restrict' as an extension to C90 to support t= he * C99-specific `restrict' type qualifier. We happen to use `__restr= ict' as * a way to define the `restrict' type qualifier without disturbing o= lder * software that is unaware of C99 keywords. */ #if !(__GNUC__ =3D=3D 2 && __GNUC_MINOR__ =3D=3D 95) #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 #define __restrict #else #define __restrict restrict #endif #endif While the GCC __restrict extension was indeed introduced in GCC 2.95, it is not limited to this version; the extension is also not limited to C90: https://gcc.gnu.org/gcc-2.95/c++features.html Rewrite the logic in the header so that __restrict is kept alone when available. PR: 272723 MFC after: 1 week sys/sys/cdefs.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=