From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7075 Path: news.gmane.org!not-for-mail From: Sergey Dmitrouk Newsgroups: gmane.linux.lib.musl.general Subject: wchar_t and -fshort-wchar Date: Wed, 18 Feb 2015 12:53:37 +0200 Message-ID: <20150218105337.GA8567@zx-spectrum> 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 1424256828 12684 80.91.229.3 (18 Feb 2015 10:53:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2015 10:53:48 +0000 (UTC) To: Original-X-From: musl-return-7088-gllmg-musl=m.gmane.org@lists.openwall.com Wed Feb 18 11:53:46 2015 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 1YO2GI-0001co-FW for gllmg-musl@m.gmane.org; Wed, 18 Feb 2015 11:53:46 +0100 Original-Received: (qmail 9881 invoked by uid 550); 18 Feb 2015 10:53:44 -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 9837 invoked from network); 18 Feb 2015 10:53:41 -0000 Content-Disposition: inline Xref: news.gmane.org gmane.linux.lib.musl.general:7075 Archived-At: Hi, musl seems to build fine with -fshort-wchar, but when client applications are built against musl all uses of wide character literals fail due to wide type defined internally by a compiler differs from the type of `wchar_t` in musl headers. I faced this on ARM where `wchar_t` is defined as `unsigned int` by musl but it's `unsigned short` from compilers point of view. I'd expect similar issues with other targets. Would it make sense to use `__WCHAR_TYPE__` for `wchar_t` when it's available (it's already used for i386, but for different reason)? Presumably, as compiler is responsible for creating wide literals, libc would better agree with it on the type. Of course, this makes sense only if you intend to support builds with `-fshort-wchar` flag, which are not very common I believe. Best regards, Sergey