mailing list of musl libc
 help / color / mirror / code / Atom feed
* wchar_t and -fshort-wchar
@ 2015-02-18 10:53 Sergey Dmitrouk
  2015-02-18 11:54 ` Szabolcs Nagy
  2015-02-20  4:26 ` Rich Felker
  0 siblings, 2 replies; 6+ messages in thread
From: Sergey Dmitrouk @ 2015-02-18 10:53 UTC (permalink / raw)
  To: musl

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-20  7:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18 10:53 wchar_t and -fshort-wchar Sergey Dmitrouk
2015-02-18 11:54 ` Szabolcs Nagy
2015-02-18 14:04   ` Sergey Dmitrouk
2015-02-20  4:26 ` Rich Felker
2015-02-20  6:53   ` Sergey Dmitrouk
2015-02-20  7:27     ` Rich Felker

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).