public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28368]  New:
@ 2006-07-13  6:28 gcc-bugzilla at gcc dot gnu dot org
  2007-03-07 14:48 ` [Bug c/28368] -std=c89 doesn't warn about gcc's "?:" extension lloyd at randombit dot net
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2006-07-13  6:28 UTC (permalink / raw)
  To: gcc-bugs


        -std=c89 doesn't warn about gcc's "?:" extension

Environment:
System: Linux rho 2.6.15-1-amd64-k8 #2 Tue Mar 7 06:53:26 UTC 2006 x86_64
GNU/Linux
Architecture: x86_64


host: x86_64-unknown-linux-gnu
build: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-gnu
configured with: /mirror/d/gcc/configure --disable-nls
--prefix=/p/p/gcc-2006-06-29.18h54 --disable-multilib --enable-languages=c

How-To-Repeat:

For example, I expected this to fail:

  echo 'int main() { return 3 ?: 1; }' > k.c
  gcc -W -Wall -std=c89 k.c

With --pedantic, I do get a warning:

  $ gcc --pedantic -std=c89 k.c
  k.c: In function 'main':
  k.c:1: warning: ISO C forbids omitting the middle term of a ?: expression

I suppose that using -std=c99 should evoke a warning, too.


-- 
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jim at meyering dot net
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

end of thread, other threads:[~2008-02-16 18:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13  6:28 [Bug c/28368] New: gcc-bugzilla at gcc dot gnu dot org
2007-03-07 14:48 ` [Bug c/28368] -std=c89 doesn't warn about gcc's "?:" extension lloyd at randombit dot net
2007-03-07 17:57 ` manu at gcc dot gnu dot org
2007-03-07 18:04 ` joseph at codesourcery dot com
2007-03-07 18:11 ` manu at gcc dot gnu dot org
2007-03-07 21:06 ` joseph at codesourcery dot com
2007-03-08 15:52 ` manu at gcc dot gnu dot org
2008-01-18 12:46 ` manu at gcc dot gnu dot org
2008-02-16 16:30 ` manu at gcc dot gnu dot org
2008-02-16 18:16 ` manu at gcc dot gnu dot org
2008-02-16 18:21 ` manu at gcc dot gnu dot 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).