From nobody Mon Aug 24 17:16:36 2026 X-Original-To: dev-commits-src-main@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 4hTHdc0S9Tz6pfDN; Mon, 24 Aug 2026 17:16:52 +0000 (UTC) (envelope-from kfv@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hTHdb70Dnz3GsR; Mon, 24 Aug 2026 17:16:51 +0000 (UTC) (envelope-from kfv@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787591812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/vmUywgN+xMl6B5CbGpecD3meCdSfnLLVpoIorm6KQA=; b=V3+mNQVwyOp6vbm7LoOL9H5lYWPx2W/NSbpl7tJ4ReVbBYxL5oRJX1VmFQTk6pb507XpTy VBONZTs9etMeCT2R1myL4v1r3gnKb98mgoQM8dzJxBl9xIE/g2An1/F7z/31Aab3Zo2Om4 +SG/u65RPLzcFI32+LcQpW8X90JaCWBfkVKUK7sxhPhMdRR67zeADkKEvjt6X38PmStu1q Zy/eGD62Unn8AIZZurq9qJE4MHHLaOncIGy0eO4Ejr3Q1b/tmgPM2wwmedjP8yT+wXRglW DwsgCB/vdUAgBcun2JHZ9kxXkdnROkYL1P0UIUgimuHEv+FPw3MpM+lYV6V39w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787591812; a=rsa-sha256; cv=none; b=GYgTURXnqLsxvjdSmOsVdxoJssU2nuu4xR5Y2R7Y2jUAxiWkiuYbfdwoOUJOfC4gjkYKsQ Z6++XdIGdH667g5gLOBHBCKXLnxG7Le4J1OtNM2Uw5wiraR8/LTLzlU075CKi7AytVkdzw 4JTCpifPcHEV1rtufsHOZDbe1v/T8W1lxbFTH+p37HO3arD3olU2UQOsNzFA8rRpptOalo uKDdd3DBRLdw3AHG43vcIh1d07W202QUqvmDv1Nh6JMCxdNhsrWk8U7GGtsRZy6FHJ4Sav O7J4tHRNJiekn3h4wZv/gFfpBURN5NUaO2GZXLkgmfGZ7w4SSiJLpf3dFD96zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787591812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/vmUywgN+xMl6B5CbGpecD3meCdSfnLLVpoIorm6KQA=; b=SOhqqBmSplk5szqXxH/VRr1BnUDDFuJMw+ikOd/icM2Jw/yZuauixQOeoqddzYSd1mUSi5 xUEKJ5CpYcFMB+0Yqw21+3hSAvFdQPnpve//SzcZb5o6YGB1aHmz9XeYe1JhdjQM4jTDqd rMNoe83+V+uRsOLZQyQFqQwOSys+WraTB01/ySXsrqYogQUtCe8uXEkQaxBYlDD971Jxnl 7cDB249rsk3vPnBiPSb65OMUO0ETd7QcTrbvWXLwZC468ADOONzP2xPokrGFWholF5BbwV wUVIw1cPa4WXmwf+wYnSEbUGasJVf6TrvcxsGITe5hjxqFSUnGowIlXX+tEpbA== Received: from smtpclient.apple (unknown [135.136.39.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: kfv/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4hTHdZ2ynWzHnZ; Mon, 24 Aug 2026 17:16:49 +0000 (UTC) (envelope-from kfv@FreeBSD.org) Content-Type: multipart/signed; boundary="Apple-Mail=_FA03A742-7F62-43B9-B4C1-E3A13AB38280"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.100.1.1.5\)) Subject: Re: git: 8d29d2429649 - main - libc: Restore prior C23 include guards From: Faraz Vahedi In-Reply-To: Date: Mon, 24 Aug 2026 20:46:36 +0330 Cc: Warner Losh , src-committers , "" , "" Message-Id: References: <6a85843a.3287f.2aec5cf8@gitrepo.freebsd.org> <865x0z6526.fsf@ltc.des.dev> <86wltf4mz8.fsf@ltc.des.dev> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.3864.100.1.1.5) --Apple-Mail=_FA03A742-7F62-43B9-B4C1-E3A13AB38280 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 24, 2026, at 18:22, Faraz Vahedi wrote: >=20 >> On Aug 24, 2026, at 17:52, Dag-Erling Sm=C3=B8rgrav = wrote: >>=20 >> Warner Losh writes: >>> Dag-Erling Sm=C3=B8rgrav writes: >>>> Shouldn't these be conditional on the visibility macros? >>> Seems fine to me since it's in the implementation namespace. Maybe >>> you could share your reasoning. >>=20 >> Imagine a library which is is written to be backward compatible with = C99 >> but offers additional functionality which requires a C23 compiler and >> uses one of these __STDC_VERSION_* macros to control its visibility = in >> the header. An application written in C99 uses this library and = builds >> with -std=3Dc99. Because we set __STDC_VERSION_* unconditionally, = the >> library now exposes C23-only code to the C99 program, which therefore >> fails to build. Therefore, these macros should only be defined if >> __BSD_VISIBLE || __ISO_C_VISIBLE >=3D 2023. >=20 > Since these macros solely advertise which revision of the header our = libc implements > and are neither a language-mode nor visibility switch, I believe = we=E2=80=99re fine. C23-only > identifiers are already gated on our visibility macros, and exposure = of these feature > test macros per se are not of any harm, even for libraries targeting = modes prior to C23. > For the same very reason, it is also fine to have these as include = guards (which brand > new C23 headers like and still do). >=20 > My restoration of traditional guards was just to avoid any possible = POLA violation for > those depending on them (albeit wrong) as reported by dim for math/gmp = port as an > example. >=20 > Cheers, > Faraz I=E2=80=99d also like to add that exposing these macros is quite useful = and expected. They are how a program can check whether or not a libc header implements a given = revision, since -std=3Dc23, for example, only speaks for the compiler and cannot = guarantee that the libc supports or has ever shipped that revision of the header. Yours, Faraz= --Apple-Mail=_FA03A742-7F62-43B9-B4C1-E3A13AB38280 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEnunneCmADnpNx8ZMLdpU9MVz/74FAmqMfHQACgkQLdpU9MVz /75GvRAAxtmAnOvpDTAH700bTWA6iiF3pzDjk7+1hz3RDNY5ZKrloHsXim4vb+QI QeB0Satk17xszVzOkYTfLuLdaNVd3oF7zAN61X5QGiX/sDS2Dsgw0PJ5AqbtLfH2 HrCVICVJRaO8XuOKEdEQEfFXF0v0cbvXiNMeWOyCa0mvGkjDDCJtfUO6sVdpJK7m TMVESwa/3Bip5FFVza43y+AokyhpEDakIR3upiFrcQDSiWogE705w8vn3SlGloH6 NrmppvcZwwvzMSb0g0HKQqa9hpDzRwL/2mLg/cFwU1TgSVnAWSLJeRYSeXAIbdQC YbvcpZzH99GWsyfQ1qmBNZD/qOyMzy26VFjYtqYw0Lfs6QZoWg5alnAg2hAO+5oE l5VLIPDlWHZ3v0M0wycRqRHq0wXpA0IOYMCP1/AkAvSg5JK0HBCZDTgbGKPJM8Tu 4N98XXSITljK0yFKzZzevoNEcMhNs9juiCEAKV0pI1b6wkXFMevGulI/hLMFPTp1 4Aw16aVDyUH1ZT22smWXSRNfGb3HtBeXwoV9Z7C0//rC6ukvPZXy8ocxGfZ3QM1G Z6MKn8jUMK8zqRzW5IFSDx4nLxDRi7nQynffKEqf6tj24P/UypfRPstr/58Mb2nz DyRFjbUT8Zcsqx21+jj09MYKUkBAXiZuyAoPrpk2R+CwMxksGAQ= =EZaY -----END PGP SIGNATURE----- --Apple-Mail=_FA03A742-7F62-43B9-B4C1-E3A13AB38280--