http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56086



             Bug #: 56086

           Summary: when compiling C code with -std=gnu99 macro

                    __STDC_UTF_16__ is defined

    Classification: Unclassified

           Product: gcc

           Version: 4.7.2

            Status: UNCONFIRMED

          Severity: minor

          Priority: P3

         Component: c

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: rjarr...@mathworks.com





Created attachment 29255

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29255

sample program



The macro __STDC_UTF_16__ is unexpectedly defined  when compiling  C code using

gcc 4.7.2 (also present in gcc 4.7.1)



This is a regression from gcc 4.5.3. (also gcc 4.4.6)



compilation line:

gcc -c -std=gnu99 gcc47_stdc_utf_16.c 



expected result: no output



actual result:

gcc47_stdc_utf_16.c:3:2: warning: #warning __STDC_UTF_16__ defined [-Wcpp]





use case was in a header file used for both C and C++ compilation that

contained

#if defined(__STDC_UTF_16__)

...

#endif



workaround:

use :#if (__cplusplus && defined(__STDC_UTF_16__)) in place of





#if defined(__STDC_UTF_16__)

Reply via email to