mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Yuri Kozlov <yuray@komyakino.ru>
To: musl@lists.openwall.com
Subject: Re: type of wchar_t
Date: Thu, 15 Nov 2012 16:36:31 +0400	[thread overview]
Message-ID: <20121115163631.0db22beb@keeper.home.local> (raw)
In-Reply-To: <20121115115340.GH12537@port70.net>

В Thu, 15 Nov 2012 12:53:40 +0100
Szabolcs Nagy <nsz@port70.net> пишет:

> * Yuri Kozlov <yuray@komyakino.ru> [2012-11-15 13:09:50 +0400]:
> > 
> > arch/x86_64/bits/alltypes.h.sh
> > #ifndef __cplusplus
> > TYPEDEF int wchar_t;
> > #endif
> > 
> > 
> > arch/i386/bits/alltypes.h.sh
> > #ifndef __cplusplus
> > #ifdef __WCHAR_TYPE__
> > TYPEDEF __WCHAR_TYPE__ wchar_t;
> > #else
> > TYPEDEF long wchar_t;
> > #endif
> > #endif
> > 
> > (__WCHAR_TYPE__ is not defined everyware, so TYPEDEF long wchar_t;)
> > 
> > arch/arm/bits/alltypes.h.sh
> > #ifndef __cplusplus
> > TYPEDEF unsigned wchar_t;
> > #endif
> > 
> > 
> > Why type of wchar_t is so differs?
> > 
[...]
> c11 has generics (implemented in the compiler) so the
> compiler must have a type internally for L'' or L""[0]
> and wchar_t must be defined as that type
> 
> so we either use the __WCHAR_TYPE__ defined by the
> compiler (when it's defined), or use the abi specs
> (which gives the align+size+sign information and
> hopefully compilers agree on a single int type when
> there are multiple choices)

Thanks for clarification.
Hah, gcc emit a __WCHAR_TYPE__ for arm as unsigned. Wow.
$ arm-linux-gnueabi-gcc -dM -E - < /dev/null |grep __WCHAR_T
#define __WCHAR_TYPE__ unsigned int


-- 
Best Regards,
Yuri Kozlov



  reply	other threads:[~2012-11-15 12:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15  9:09 Yuri Kozlov
2012-11-15 11:53 ` Szabolcs Nagy
2012-11-15 12:36   ` Yuri Kozlov [this message]
2012-11-15 13:26     ` Rich Felker

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=20121115163631.0db22beb@keeper.home.local \
    --to=yuray@komyakino.ru \
    --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).