From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9793 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Defining __STDC_ISO_10646__, __STDC_IEC_559__ and so on with musl? Date: Thu, 31 Mar 2016 10:49:22 -0400 Message-ID: <20160331144922.GU21636@brightrain.aerifal.cx> References: <20160331143547.GP9862@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1459435782 7956 80.91.229.3 (31 Mar 2016 14:49:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2016 14:49:42 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9806-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 31 16:49:41 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1alduj-0006Zy-Qy for gllmg-musl@m.gmane.org; Thu, 31 Mar 2016 16:49:37 +0200 Original-Received: (qmail 25756 invoked by uid 550); 31 Mar 2016 14:49:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 25736 invoked from network); 31 Mar 2016 14:49:35 -0000 Content-Disposition: inline In-Reply-To: <20160331143547.GP9862@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9793 Archived-At: On Thu, Mar 31, 2016 at 04:35:48PM +0200, Szabolcs Nagy wrote: > * Masanori Ogino [2016-03-31 20:34:22 +0900]: > > The C standard specifies some predefined macros to determine > > implementation-dependent characteristics, e.g. __STDC_ISO_10646__. > > However, it seems that those macros are omitted with musl-based > > toolchains. (I read cross-musl patches and tested with Gentoo's musl > > toolchain.) > > > > glibc handles them using a small header file named stdc-predef.h and a > > yes, this is the right approach we just never got > around adding it. i think it should contain > > #if __GCC_IEC_559 > 0 > #define __STDC_IEC_559__ 1 > #endif > > #if __GCC_IEC_559_COMPLEX > 0 > #define __STDC_IEC_559_COMPLEX__ 1 > #endif This one is wrong; GCC lies that it supports Annex G, but lacks pure imaginary types and _Imaginary_I, one of the main things you would use this macro to assume the availability of. > #define __STDC_ISO_10646__ 201505L I don't think our Unicode coverage is up to that point yet; it needs to be updated. But the general idea is right, yes. > > hook to GCC. (glibc has the header separately and GCC treats it > > specially since the macros should be defined even if the source code > > doesn't include any headers.) > > > > Could we provide the macros with similar approaches or patches to GCC > > to just define them? > > > > i think we don't have to modify gcc, > on *-linux* targets t-glibc is included > which does the stdc-predef.h include magic. Yes, this is the way I've always wanted to do it. We _could_ include spec patches in musl-cross* for adding stdc-predef.h to pre-4.8 GCC versions we support, though. Rich