From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2278 Path: news.gmane.org!not-for-mail From: Yuri Kozlov Newsgroups: gmane.linux.lib.musl.general Subject: Re: type of wchar_t Date: Thu, 15 Nov 2012 16:36:31 +0400 Message-ID: <20121115163631.0db22beb@keeper.home.local> References: <20121115130950.17ed134c@keeper.home.local> <20121115115340.GH12537@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1352983089 11943 80.91.229.3 (15 Nov 2012 12:38:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Nov 2012 12:38:09 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2279-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 15 13:38:17 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TYyi1-0002ix-1n for gllmg-musl@plane.gmane.org; Thu, 15 Nov 2012 13:38:17 +0100 Original-Received: (qmail 21967 invoked by uid 550); 15 Nov 2012 12:38:06 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21954 invoked from network); 15 Nov 2012 12:38:04 -0000 In-Reply-To: <20121115115340.GH12537@port70.net> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:2278 Archived-At: В Thu, 15 Nov 2012 12:53:40 +0100 Szabolcs Nagy пишет: > * Yuri Kozlov [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