mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Defining __STDC_ISO_10646__, __STDC_IEC_559__ and so on with musl?
Date: Thu, 31 Mar 2016 10:49:22 -0400	[thread overview]
Message-ID: <20160331144922.GU21636@brightrain.aerifal.cx> (raw)
In-Reply-To: <20160331143547.GP9862@port70.net>

On Thu, Mar 31, 2016 at 04:35:48PM +0200, Szabolcs Nagy wrote:
> * Masanori Ogino <masanori.ogino@gmail.com> [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


  parent reply	other threads:[~2016-03-31 14:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31 11:34 Masanori Ogino
2016-03-31 14:35 ` Szabolcs Nagy
2016-03-31 14:48   ` Christian Neukirchen
2016-03-31 14:54     ` Masanori Ogino
2016-03-31 14:49   ` Rich Felker [this message]
2016-03-31 14:50   ` Masanori Ogino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160331144922.GU21636@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).