From mi@aldan.algebra.com  Sat Jan 26 23:33:59 2008
Return-Path: <mi@aldan.algebra.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93B1C16A417
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jan 2008 23:33:59 +0000 (UTC)
	(envelope-from mi@aldan.algebra.com)
Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224])
	by mx1.freebsd.org (Postfix) with ESMTP id 54D7813C45D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jan 2008 23:33:58 +0000 (UTC)
	(envelope-from mi@aldan.algebra.com)
Received: from aldan.algebra.com (localhost [127.0.0.1])
	by aldan.algebra.com (8.14.1/8.14.1) with ESMTP id m0QNXwKc091866
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jan 2008 18:33:58 -0500 (EST)
	(envelope-from mi@aldan.algebra.com)
Received: (from mi@localhost)
	by aldan.algebra.com (8.14.1/8.14.1/Submit) id m0QNXvXA091865;
	Sat, 26 Jan 2008 18:33:57 -0500 (EST)
	(envelope-from mi)
Message-Id: <200801262333.m0QNXvXA091865@aldan.algebra.com>
Date: Sat, 26 Jan 2008 18:33:57 -0500 (EST)
From: "Mikhail T." <mi@aldan.algebra.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: warning in C++'s system header
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         120025
>Category:       bin
>Synopsis:       gcc(1): warning in C++'s system header
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 26 23:40:04 UTC 2008
>Closed-Date:    Tue Mar 24 01:05:11 UTC 2009
>Last-Modified:  Tue Mar 24 01:05:11 UTC 2009
>Originator:     Mikhail T.
>Release:        FreeBSD 8.0
>Organization:
Virtual Estates, Inc.
>Environment:
	7.x or 8.x system, where gcc-4.2 is the system compiler
>Description:

The following bug prevents ANY C++ code from being built with WARNS set
to anything, because -Wsystem-headers is included even when WARNS=1 (see
share/mk/bsd.sys.mk):

In file included from /usr/include/c++/4.2/ios:50,
                 from /usr/include/c++/4.2/ostream:45,
                 from /usr/include/c++/4.2/iostream:45,
		...
/usr/include/c++/4.2/bits/basic_ios.h: In member function 'void std::basic_ios<_CharT, _Traits>::_M_setstate(std::_Ios_Iostate)':
/usr/include/c++/4.2/bits/basic_ios.h:156: warning: empty body in an if-statement

>How-To-Repeat:

One example would be to build /usr/ports/graphics/libfpx/

>Fix:

Explicitly set NO_WERROR, as is currently done in 7.x. This defeats the
main purpose of WARNS, however...
>Release-Note:
>Audit-Trail:

From: Bruce Cran <bruce@cran.org.uk>
To: bug-followup@FreeBSD.org, mi@aldan.algebra.com
Cc:  
Subject: Re: bin/120025: gcc(1): warning in C++'s system header
Date: Mon, 23 Mar 2009 22:45:46 +0000

 I've been unable to recreate the issue here with a simple C++
 application built with -Wsystem-headers on 7-STABLE and 8-CURRENT.  Do
 you have a minimal program which shows the problem?  The code and
 environment I used was as follows:
 
 > c++ -v
 Using built-in specs.
 Target: i386-undermydesk-freebsd
 Configured with: FreeBSD/i386 system compiler
 Thread model: posix
 gcc version 4.2.1 20070719  [FreeBSD]
 > cat test.cpp
 #include <fstream>
 #include <iostream>
 
 using namespace std;
 
 int main(void)
 {
 	char filename[PATH_MAX];
 	cout << "Enter filename: ";
 	cin >> filename;
 
 	ofstream file(filename, ios::out);
 	file << "Hello World" << endl;
 	file.close();
 	return 0;
 }
 
 > c++ -Wsystem-headers -march=c3-2  test.cpp  -o test
 >
 
 -- 
 Bruce

From: "Mikhail T." <mi+thun@aldan.algebra.com>
To: Bruce Cran <bruce@cran.org.uk>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/120025: gcc(1): warning in C++'s system header
Date: Mon, 23 Mar 2009 20:13:02 -0400

 Bruce Cran ():
 > I've been unable to recreate the issue here with a simple C++
 > application built with -Wsystem-headers on 7-STABLE and 8-CURRENT.  Do
 > you have a minimal program which shows the problem?
 Nope, don't see it any more either... Yours,
 
     -mi
 
State-Changed-From-To: open->closed  
State-Changed-By: brucec 
State-Changed-When: Tue Mar 24 01:01:13 UTC 2009 
State-Changed-Why:  
Submitter is unable to reproduce the issue. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120025 
>Unformatted:
