public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56086] New: when compiling C code with -std=gnu99 macro __STDC_UTF_16__ is defined
@ 2013-01-23 19:26 rjarrett at mathworks dot com
  2013-01-23 20:48 ` [Bug c/56086] " joseph at codesourcery dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rjarrett at mathworks dot com @ 2013-01-23 19:26 UTC (permalink / raw)
  To: gcc-bugs


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


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

end of thread, other threads:[~2013-01-29 17:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 19:26 [Bug c/56086] New: when compiling C code with -std=gnu99 macro __STDC_UTF_16__ is defined rjarrett at mathworks dot com
2013-01-23 20:48 ` [Bug c/56086] " joseph at codesourcery dot com
2013-01-27 16:12 ` rjarrett at mathworks dot com
2013-01-27 16:14 ` rjarrett at mathworks dot com
2013-01-28  3:43 ` joseph at codesourcery dot com
2013-01-28  8:29 ` jakub at gcc dot gnu.org
2013-01-29 17:43 ` jason at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).