From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 40B1727444 for ; Mon, 26 Feb 2024 08:15:07 +0100 (CET) Received: (qmail 30406 invoked by uid 550); 26 Feb 2024 07:11:34 -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 30371 invoked from network); 26 Feb 2024 07:11:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:subject:in-reply-to:references:message-id: mime-version:content-transfer-encoding; bh=QfVEgBiSsvEfzVGPMQGtmYLhVzBG8hk5Wcs+bBDsa60=; b=iWy+mC97au5i3fcYv43ymTBmMydASc31r8BYmewNfxvM9YhagZS/10Ev 9PaAFuKXy27Uv+okpSofhbCfLGeUkPj7YstsdxkXh3i0IBHUQC01Rx2Xc EJiprdkfiyJVmvW24Yed9Zk8ZkmPNQy+woZAEBeF/nCHDbfCcUWKpRscn U=; Authentication-Results: mail2-relais-roc.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="6.06,185,1705359600"; d="scan'208";a="153722555" Date: Mon, 26 Feb 2024 08:14:52 +0100 From: Jens Gustedt To: musl@lists.openwall.com, Gabriel Ravier , Rich Felker , Jules Maselbas User-Agent: K-9 Mail for Android In-Reply-To: <0a3fb421-dc8f-4cbb-97e3-b11cc7608d24@gmail.com> References: <20240125141440.13906-1-jmaselbas@zdiv.net> <20240226021749.GG4163@brightrain.aerifal.cx> <0a3fb421-dc8f-4cbb-97e3-b11cc7608d24@gmail.com> Message-ID: <6E11337A-7274-40D9-8124-B86EB32B204B@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: =?US-ASCII?Q?Re=3A_=5Bmusl=5D_=5BPATCH_v2=5D_prevent_from_r?= =?US-ASCII?Q?edefining_=5F=5FSTDC=5FUTF=5F=7B16=2C32=7D=5F=5F_macros?= Hi Am 26=2E Februar 2024 04:47:22 MEZ schrieb Gabriel Ravier : > On 2/26/24 02:17, Rich Felker wrote: > > On Thu, Jan 25, 2024 at 03:14:40PM +0100, Jules Maselbas wrote: > >> Undefine any previous __STDC_UTF_{16,32}__ macros before defining > >> them to prenvent any warnings of redefining macros=2E > >>=20 > >> --- > >> v2: > >> - changed `#if !define(=2E=2E=2E)` guard to `#undef`, as suggested = by Rich Felker > >>=20 > >> I encountered this "issue" trying to compile a program with the -isys= tem > >> option to override toolchain/installed musl headers with one from sou= rce=2E > >>=20 > >> include/stdc-predef=2Eh | 3 +++ > >> 1 file changed, 3 insertions(+) > >>=20 > >> diff --git a/include/stdc-predef=2Eh b/include/stdc-predef=2Eh > >> index af1a2799=2E=2E5ccd884d 100644 > >> --- a/include/stdc-predef=2Eh > >> +++ b/include/stdc-predef=2Eh > >> @@ -7,7 +7,10 @@ > >> #define __STDC_IEC_559__ 1 > >> #endif > >> +#undef __STDC_UTF_16__ > >> #define __STDC_UTF_16__ 1 > >> + > >> +#undef __STDC_UTF_32__ > >> #define __STDC_UTF_32__ 1 > >> #endif > >> --=20 > >> 2=2E43=2E0 > > I merged this, but now gcc warns about undefining them if system > > header warnings aren't suppressed=2E I'm not sure what the justificati= on > > is for that=2E=2E=2E *sigh* > >=20 > > Rich >=20 > It appears as though since 2001 GCC makes it so that any redefinition or= undefinition of any macro with a name starting with "__STDC_" (with hard-c= oded exceptions for __STDC_FORMAT_MACROS, __STDC_LIMIT_MACROS and __STDC_CO= NSTANT_MACROS) always results in a warning (from reading the code this does= n't seem to be tied to any -W switch, so it's simply entirely impossible to= work around) >=20 The way to go would be to #ifdef them, not to use #undef=2E=20 These are really a language feature and not library, so anything that this= should do is repair work for older compilers=2E The compiler's setting, i= f any, should prime over the C library=2E=20 With C23 these two macros become mandatory=2E Jens --=20 Jens Gustedt - INRIA & ICube, Strasbourg, France