This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/56086] New: when compiling C code with -std=gnu99 macro __STDC_UTF_16__ is defined
- From: "rjarrett at mathworks dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Jan 2013 19:25:49 +0000
- Subject: [Bug c/56086] New: when compiling C code with -std=gnu99 macro __STDC_UTF_16__ is defined
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: rjarrett@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__)