Bug 40402

Summary: /usr/include/stddef.h and /usr/include/stdlib.h cause compiler warnings
Product: Base System Reporter: pfeifer <pfeifer>
Component: standardsAssignee: freebsd-standards (Nobody) <standards>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.6-STABLE   
Hardware: Any   
OS: Any   

Description pfeifer 2002-07-10 07:40:01 UTC
/usr/include/stddef.h and /usr/include/stdlib.h cause compiler warnings
with g++ and -pedantic.

This is a regression from 4.5-RELEASE and also reproducible on ref4;
-CURRENT and ref5 do not seem to have this problem.

How-To-Repeat: 
% cat x.cc
#include <iostream>
#include <string>

int main() { }

% g++ -pedantic x.cc
In file included from /usr/include/g++/_G_config.h:101,
                 from /usr/include/g++/libio.h:30,
                 from /usr/include/g++/streambuf.h:36,
                 from /usr/include/g++/iostream.h:31,
                 from /usr/include/g++/iostream:6,
                 from x.cc:1:
/usr/include/stddef.h:58: warning: redeclaration of wchar_t as `int'
In file included from /usr/include/g++/stl_alloc.h:54,
                 from /usr/include/g++/alloc.h:21,
                 from /usr/include/g++/std/bastring.h:39,
                 from /usr/include/g++/string:6,
                 from x.cc:2:
/usr/include/stdlib.h:108: warning: ANSI C++ does not support `long long'
/usr/include/stdlib.h:112: warning: ANSI C++ does not support `long long'
Comment 1 Stefan Farfeleder 2002-07-10 09:53:28 UTC
On Wed, Jul 10, 2002 at 08:38:45AM +0200, Gerald Pfeifer wrote:
> 
> >Number:         40402
> >Category:       standards
> >Synopsis:       /usr/include/stddef.h and /usr/include/stdlib.h cause compiler warnings

<snip>

Please see also http://www.freebsd.org/cgi/query-pr.cgi?pr=40084 .

Regards,
Stefan Farfeleder
Comment 2 M. Warner Losh 2002-08-07 18:19:17 UTC
Also, the compiler suppresses the long long warnings when no other
warnings are present in system headers.

Warner
Comment 3 Gerald Pfeifer freebsd_committer freebsd_triage 2003-01-10 19:46:04 UTC
State Changed
From-To: open->closed

A fix has been MFCed Fri, 13 Dec 2002. 
See http://www.freebsd.org/cgi/query-pr.cgi?pr=43780 for details.