GCC Bugzilla has been upgraded from version 4.4.9 to 5.0rc3. If you see any problem, please report it to bug 64968.
Bug 32368 - warnings from system headers not suppressed.
Summary: warnings from system headers not suppressed.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.3
: P3 normal
Target Milestone: 4.3.0
Assignee: Tom Tromey
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2007-06-16 17:20 UTC by Pawel Sikora
Modified: 2008-03-14 16:51 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.0
Known to fail:
Last reconfirmed: 2007-11-02 21:02:56


Attachments
testcase (319 bytes, application/octet-stream)
2007-06-16 17:20 UTC, Pawel Sikora
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2007-06-16 17:20:35 UTC
$ g++ -isystem sys x.cpp -c -Wall -O
sys/x.hpp: In function 'int main()':
sys/x.hpp:7: warning: 'i' is used uninitialized in this function
sys/x.hpp:6: note: 'i' was declared here

i ran into this during playing with new boost libraries.
Comment 1 Pawel Sikora 2007-06-16 17:20:56 UTC
Created attachment 13714 [details]
testcase
Comment 2 Paolo Carlini 2007-06-16 19:19:41 UTC
At variance with c++/32256, this one apparently happens as "C" code too... Probably should be not categorized as C++-only...
Comment 3 Pawel Sikora 2007-06-19 06:44:17 UTC
(In reply to comment #2)
> At variance with c++/32256, this one apparently happens as "C" code too...
> Probably should be not categorized as C++-only...

these little bugs (PR32368, PR32256) are treated as blockers
by people having `-Wall -Werror` in theirs projects.
could we fix this issue easily and quickly in 4.x?
Comment 4 Tom Tromey 2007-11-02 21:02:44 UTC
Testing a patch.

Comment 5 Tom Tromey 2007-11-06 15:57:18 UTC
Subject: Bug 32368

Author: tromey
Date: Tue Nov  6 15:57:02 2007
New Revision: 129936

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129936
Log:
gcc
	PR c++/32256, PR c++/32368:
	* function.c (saved_in_system_header): New global.
	(push_cfun): Save in_system_header.
	(pop_cfun): Restore in_system_header.
	(push_struct_function): Save in_system_header.
gcc/testsuite
	PR c++/32368:
	* g++.dg/warn/pragma-system_header3.h: New.
	* g++.dg/warn/pragma-system_header3.C: New.

	PR c++/32256:
	* g++.dg/warn/pragma-system_header4.C: New.
	* g++.dg/warn/pragma-system_header4.h: New.

Added:
    trunk/gcc/testsuite/g++.dg/warn/pragma-system_header3.C
    trunk/gcc/testsuite/g++.dg/warn/pragma-system_header3.h
    trunk/gcc/testsuite/g++.dg/warn/pragma-system_header4.C
    trunk/gcc/testsuite/g++.dg/warn/pragma-system_header4.h
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/function.c
    trunk/gcc/testsuite/ChangeLog

Comment 6 Tom Tromey 2007-11-06 16:01:55 UTC
Fixed on trunk.
Comment 7 Richard Biener 2008-03-14 16:51:47 UTC
We have one regression open for this.  Let's close this as fixed.