wchar_t appears to be Unicode, but __STDC_ISO_10646__ is not defined. Tested with both the core and the ports versions: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523 Target: x86_64-unknown-freebsd9.0 Thread model: posix clang version 3.1 (branches/release_31) Target: amd64-portbld-freebsd9.0 Thread model: posix Test file: ---------- #include <stdlib.h> #include <wchar.h> #include <stdio.h> int main(void) { #ifdef __STDC_ISO_10646__ printf("__STDC_ISO_10646__ defined\n"); #else printf("__STDC_ISO_10646__ NOT defined\n"); #endif return 0; } Fix: Have the compiler define the macro to its appropriate value. How-To-Repeat: Compile and run the above test file (here "test.c"): $ clang test.c -o test $ ./test __STDC_ISO_10646__ NOT defined $ /usr/local/bin/clang test.c -o test $ ./test __STDC_ISO_10646__ NOT defined
Responsible Changed From-To: freebsd-bugs->freebsd-toolchain let's see if anyone on toolchain@ has an opinion.
Hi Tim, On FreeBSD, we should explicitly not define __STDC_ISO_10646__, as this condition does not hold. On FreeBSD, wchar_t contains the code point of the character as represented in the original character set. For example, if your LC_CTYPE is en_US.ISO8859-15 and you convert a Euro symbol to a wchar_t, it is stored internally as 0xa4 -- not 0x20ac. There is no character conversion. Related to this, I am working on a change right now to let Clang at least define __STDC_MB_MIGHT_NEQ_WC__, __STDC_UTF_16__ and __STDC_UTF_32__. -- Ed Schouten <ed@80386.nl>
State Changed From-To: open->closed Closing, as we should not define __STDC_ISO_10646__.