public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52127] New: pedantic-errors is inconsistent in its behavior
@ 2012-02-05 21:20 jengelh at medozas dot de
  2012-02-05 21:39 ` [Bug c/52127] " redi at gcc dot gnu.org
  2012-02-05 23:28 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: jengelh at medozas dot de @ 2012-02-05 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52127
           Summary: pedantic-errors is inconsistent in its behavior
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jengelh@medozas.de


Created attachment 26577
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26577
testcase

Description:
The attached testcase, when its # lines are stripped, suddenly produces an
error.

Actions:
$ gcc -c noprob.i -std=gnu99 -pedantic -pedantic-errors
$ grep -v '^#' noprob.i >boom.i
$ gcc -c boom.i -std=gnu99 -pedantic -pedantic-errors

Actual result:
boom.i:138:3: error: ISO C99 doesn’t support unnamed structs/unions [-pedantic]

Expected result:
- Either have noprob.i fail as well (because it contains the same code), or
- Have boom.i succeed, because I am compiling with GNU99 (not ISO C99) where, I
believe, unnamed structs are ok.

Additional info:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.6/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.6
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.6
--enable-linux-futex --without-system-libunwind --with-arch-32=i586
--with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.6.2 (SUSE Linux)
openSUSE 12.1

Also occurs with
gcc version 4.7.0 20120111 [trunk revision 183092] (SUSE Linux)


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

* [Bug c/52127] pedantic-errors is inconsistent in its behavior
  2012-02-05 21:20 [Bug c/52127] New: pedantic-errors is inconsistent in its behavior jengelh at medozas dot de
@ 2012-02-05 21:39 ` redi at gcc dot gnu.org
  2012-02-05 23:28 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2012-02-05 21:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-05 21:39:16 UTC ---
You need -Wsystem-headers to enable the diagnostic in a system header

Stripping the # lines means it is no longer considered a system header


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

* [Bug c/52127] pedantic-errors is inconsistent in its behavior
  2012-02-05 21:20 [Bug c/52127] New: pedantic-errors is inconsistent in its behavior jengelh at medozas dot de
  2012-02-05 21:39 ` [Bug c/52127] " redi at gcc dot gnu.org
@ 2012-02-05 23:28 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-05 23:28 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-05 23:26:41 UTC ---
> # 134 "/usr/include/asm/sigcontext.h" 3 4
> ...
> union {
>  __u32 reserved3[12];
>  struct _fpx_sw_bytes sw_reserved;
>
> };

This is expected as sigcontext.h is considered a system header.  As mentioned
if you want warnings/pedantic errors from system headers then use
-Wsystem-headers .  The main issue is that most system headers use GNU C
extensions as they know they are being compiled with GCC.


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

end of thread, other threads:[~2012-02-05 23:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-05 21:20 [Bug c/52127] New: pedantic-errors is inconsistent in its behavior jengelh at medozas dot de
2012-02-05 21:39 ` [Bug c/52127] " redi at gcc dot gnu.org
2012-02-05 23:28 ` pinskia 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).