Bug 15752 - --pedantic-errors behaves differently from --pedantic with C-compiler on Linux
Summary: --pedantic-errors behaves differently from --pedantic with C-compiler on Linux
Status: RESOLVED DUPLICATE of bug 15749
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-31 16:38 UTC by Tuomo Tikkanen
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tuomo Tikkanen 2004-05-31 16:38:04 UTC
My collegue just today noticed that gcc version 3.4.0 behaves a bid odd on Linux
when --pedantic-errors is used as compilation option to C-compiler (gcc):

<helix:/tmp> cat main.c 
#include <stdio.h>
#include <stdlib.h>
int main(void){printf("Hello world\n"); exit(EXIT_SUCCESS);}

<helix:/tmp> gcc --version
gcc (GCC) 3.4.0
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

<helix:/tmp> gcc --pedantic main.c 
<helix:/tmp> gcc --pedantic-errors main.c
In file included from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:65,
                 from main.c:1:
/usr/include/_G_config.h:50: error: invalid use of structure with flexible array
member
<helix:/tmp> 

If g++ is used instead of gcc:

<helix:/tmp> g++ --version
g++ (GCC) 3.4.0
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

<helix:/tmp> g++ --pedantic main.c
<helix:/tmp> g++ --pedantic-errors main.c
<helix:/tmp> 

This problem does not happen on Solaris/HPUX version nor does it happen when
older version (tested with 3.3.3 and 2.95.3) of gcc is used.
Comment 1 Tuomo Tikkanen 2004-05-31 16:45:13 UTC
SORRY!

One should never press "reload" when "bug submitted" page is open. I don't know
how to remove bugs (if it possible at all) thus I mark this as duplicate to the
original.

*** This bug has been marked as a duplicate of 15749 ***