misc/175930: CLang does not define __STDC_ISO_10646__, despite having Unicode in wchar_t

Tim Čas tim at stdrand.com
Thu Feb 7 17:50:01 UTC 2013


>Number:         175930
>Category:       misc
>Synopsis:       CLang does not define __STDC_ISO_10646__, despite having Unicode in wchar_t
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 07 17:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Tim Čas
>Release:        9.1-RELEASE
>Organization:
n/a
>Environment:
FreeBSD tsibsd.tsi 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
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;
}

>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

>Fix:
Have the compiler define the macro to its appropriate value.


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list