From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20538 invoked from network); 23 Nov 2022 08:11:50 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 23 Nov 2022 08:11:50 -0000 Received: (qmail 24055 invoked by uid 550); 23 Nov 2022 08:11:46 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 24023 invoked from network); 23 Nov 2022 08:11:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version; bh=MhIzIhq0gKBduEwV8yYh4RYZ7YmUOEf8jzG5I716rP0=; b=PBtQA9tTo3bpEBOf9qNPnKNxT5XDzOaNgG/lU793+hvOHPJ4XX8Sl/W8 al36gvw8em4YNRiabPIUt8+VOSkVZeXDUlfP4RkrgTrAvjZSbF95J0pxd YfjM+pODy4wGl+TIvUK2ZNz22R7908u77EieNOzH1/iaU0NXCPSgc0TuC 4=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=jens.gustedt@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,186,1665439200"; d="scan'208";a="40538544" Date: Wed, 23 Nov 2022 09:11:09 +0100 From: =?UTF-8?B?SuKCkeKCmeKCmw==?= Gustedt To: "=?UTF-8?B?572X5YuH5Yia?=(Yonggang Luo)" Cc: musl@lists.openwall.com, Reini Urban Message-ID: <20221123091109.36e2bdf2@inria.fr> In-Reply-To: References: <20220923162518.56284329@inria.fr> <20221121220625.39f595fb@inria.fr> Organization: inria.fr X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) X-Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAACRQTFRFERslNjAsLTE9Ok9wUk9TaUs8iWhSrYZkj42Rz6aD3sGZ MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/xfGVZhgqJaiJSHV52=7esSW"; protocol="application/pgp-signature"; micalg=pgp-sha1 Subject: Re: [musl] C23 implications for C libraries --Sig_/xfGVZhgqJaiJSHV52=7esSW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E7=BD=97=E5=8B=87=E5=88=9A, there might be a misunderstanding here, this page is not meant for musl alone and the example code is just that, example code. How C library implementations then do it is clearly a question of their particular coding style. on Wed, 23 Nov 2022 12:31:27 +0800 you (=E7=BD=97=E5=8B=87=E5=88=9A(Yonggan= g Luo) ) wrote: > I have concern about the macros guard with __cplusplus and > __STDC_VERSION__ >=20 > #if (__cplusplus >=3D 201103L) || (__STDC_VERSION__ >=3D 202311L) > #define NULL nullptr > #elif defined(__cplusplus) > #define NULL 0L /* Any of 0, 0L, 0LL as wide as a void* > */ #else > #define NULL ((void*)0) > #endif >=20 >=20 > I think all of these should be guarded with > #if (defined(__cplusplus) && (__cplusplus >=3D 201103L)) || > (defined(__STDC_VERSION__) && (__STDC_VERSION__ >=3D 202311L)) >=20 > this is safer to avoid -Wundef complain it IIRC musl's strategy has so far been to use the implicit 0 rule for identifiers in preprocessor conditionals. But I may be mistaken. Also, `__STDC_VERSION__` has been introduced in C95, I think, do we even support compilers that don't have this? Thanks J=E2=82=91=E2=82=99=E2=82=9B --=20 :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt :: --Sig_/xfGVZhgqJaiJSHV52=7esSW Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSN9stI2OFN1pLljN0P0+hp2tU34gUCY33VnQAKCRAP0+hp2tU3 4jlZAJ0fBLYsD0U2vn/owfUq912EzoPjkQCfXZGUs1O8Gip3iazRobcIapMSO6I= =dgL2 -----END PGP SIGNATURE----- --Sig_/xfGVZhgqJaiJSHV52=7esSW--