From nobody Mon Dec 6 15:56:46 2021 X-Original-To: dev-commits-src-branches@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 56E3E18C5E3D; Mon, 6 Dec 2021 15:56:50 +0000 (UTC) (envelope-from git@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 4J77Mz5bT7z4byZ; Mon, 6 Dec 2021 15:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 7C7E7685D; Mon, 6 Dec 2021 15:56:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B6FukGY033970; Mon, 6 Dec 2021 15:56:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6Fuk1M033969; Mon, 6 Dec 2021 15:56:46 GMT (envelope-from git) Date: Mon, 6 Dec 2021 15:56:46 GMT Message-Id: <202112061556.1B6Fuk1M033969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 3f82687cdf02 - stable/13 - headers: Implement _ISOC11_SOURCES macro when __POSIX_C_SOURCE defined List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f82687cdf02983d8f3294df4d97b09cf211141b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638806208; 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; bh=HLkvxmU6EyOhHytrTVyl3N2REfmAG+nCPfpORsgCLOI=; b=v8pX8FdXqbXFjzg4MHCdg4JH3LqHapA3TZPEImYAb9wb0dDzMCGtmNlcLjbRi7l10CJt7b duBDImq482aEKfGKw1EAR6Zh4Z7oSYAJ6R6f9E71qeNobbwGe4BuzgLa0024b4u6VyM0AQ a9gvmEDSfe9hVAfK4ybcMBx1l+qwtD58c/Q76AHVuNmtJ6Ayq7B6zwBEofRVP92KiJPztq ZOHOpZo3YAy7UGXXHHlFe537E5rf/LWHMxsW0oYbryMaelL7aqd8fjyA5w3LGqQ0ylXY51 V1PenxFTAQY87INck5M+zwiJrYijvT64LOEJtZ9P0JipqOW4gTul1OIrSnA17g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638806208; a=rsa-sha256; cv=none; b=I9W+AAjLy/Cj+wB/3YCuofoRDg4tB0aQGuY4E9HS7hhuLv7fKWxImBlLVaSLJDDC8QOdCT 9HpWf/echYodP0ot2BEUguQedBiM9m6uBDE9uMHa+vd5fv7KiMNkvOQEw/EO4dZmK/SvEs shQ59+zKqPjF/O3rwYWddDQ+ab471ESkJfGqoRHO7sP1TWtsVViLQLGl+JmxJ6hQOkWnWk uwoJv3jG27voei02aFCAqsPcvCw7YqiQ0wRFitv6yGDjNARwLmsxbDGsqHt+H8lKaT+SE/ PWJURc4mReDTkFwq4zVoykfFN1jE7VZkJZ3df2smG5IJCbw0U6X+sGxiNlTVbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3f82687cdf02983d8f3294df4d97b09cf211141b commit 3f82687cdf02983d8f3294df4d97b09cf211141b Author: Warner Losh AuthorDate: 2021-05-06 22:20:19 +0000 Commit: Warner Losh CommitDate: 2021-12-06 15:56:00 +0000 headers: Implement _ISOC11_SOURCES macro when __POSIX_C_SOURCE defined When _ISOC11_SOURCES is defined for glibc at the same time __POSIX_C_SOURCE is defined, it extends the __POSIX_C_SOURCE definition by exaclty what C11 adds to the spec for each system header. We follow both OpenBSD's and glibc's convention by also C11 or higher compliation mode is selected. The Open Group is working on issuing a new version of the POSIX standard that will realign the standard from C99 to a newer version of C. This commit is a stop-gap measure for greater compatibility until that environment has been standardized. Reviewed by: brooks@, arichards@, Olivier Certne (comments tweaked before commit) PR: 255290 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29902 (cherry picked from commit a709a4f0d4e0303eb40ea1b39b4bb35837800805) --- sys/sys/cdefs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index dd11f4fb778d..3d45271d3e31 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -714,6 +714,17 @@ #define __POSIX_VISIBLE 198808 #define __ISO_C_VISIBLE 0 #endif /* _POSIX_C_SOURCE */ +/* + * Both glibc and OpenBSD enable c11 features when _ISOC11_SOURCE is defined, or + * when compiling with -stdc=c11. A strict reading of the standard would suggest + * doing it only for the former. However, a strict reading also requires C99 + * mode only, so building with C11 is already undefined. Follow glibc's and + * OpenBSD's lead for this non-standard configuration for maximum compatibility. + */ +#if _ISOC11_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +#undef __ISO_C_VISIBLE +#define __ISO_C_VISIBLE 2011 +#endif #else /*- * Deal with _ANSI_SOURCE: