From owner-freebsd-current@FreeBSD.ORG Fri Jul 18 08:34:03 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F0D337B401 for ; Fri, 18 Jul 2003 08:34:03 -0700 (PDT) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B98543F3F for ; Fri, 18 Jul 2003 08:34:02 -0700 (PDT) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id B992C54846; Fri, 18 Jul 2003 10:33:58 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id 48D8D6D455; Fri, 18 Jul 2003 10:33:58 -0500 (CDT) Date: Fri, 18 Jul 2003 10:33:58 -0500 From: "Jacques A. Vidrine" To: Michael Nottebrock Message-ID: <20030718153358.GC67855@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Michael Nottebrock , Alexander Kabaev , freebsd-current@freebsd.org References: <1058366903.81198.18.camel@skeeve> <20030717162554.680475cc.ak03@gte.com> <200307171650.15405@misha-mx.virtual-estates.net> <200307181032.59474.michaelnottebrock@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200307181032.59474.michaelnottebrock@gmx.net> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.4i-ja.1 cc: freebsd-current@freebsd.org Subject: Re: gcc-3.3 issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2003 15:34:03 -0000 [cc: list trimmed] On Fri, Jul 18, 2003 at 10:32:51AM +0200, Michael Nottebrock wrote: > I've tried to come up with a less obscure testcase: > > #include > #include > using namespace std; > > int main () > { > > string astring="Hello World"; > cout << astring << endl; > } > > Now, if I compile this on 5.1-RELEASE with > > c++ -Wnon-virtual-dtor -Wno-long-long -Wall -pedantic -W -Wpointer-arith > -Wmissing-prototypes -Wwrite-strings -DNDEBUG -DNO_DEBUG -O -pipe > -mcpu=pentiumpro -fno-check-new -L/usr/local/lib -I/usr/local/include > -I/usr/local/include -I/usr/X11R6/include -D_GETOPT_H -o helloworld > helloworld.cc > > I get a plethora of warnings: > > In file included from /usr/include/g++/memory:55, > from /usr/include/g++/string:48, > from helloworld.cc:1: > /usr/include/g++/bits/stl_alloc.h:979: warning: ISO C++ forbids the use of ` > extern' on explicit instantiations > /usr/include/g++/bits/stl_alloc.h:980: warning: ISO C++ forbids the use of ` > extern' on explicit instantiations > /usr/include/g++/bits/stl_alloc.h:981: warning: ISO C++ forbids the use of ` > extern' on explicit instantiations > /usr/include/g++/bits/stl_alloc.h:981: warning: ISO C++ forbids the use of ` > extern' on explicit instantiations > /usr/include/g++/bits/stl_alloc.h:981: warning: ISO C++ forbids the use of ` > extern' on explicit instantiations > > [and many, many more] > > but it will compile. If I omit -pedantic, none of these warnings occur. The > thing is, in -CURRENT with the new gcc, all these warnings for some reason > become errors. The other thing is, if I try this with with a ports-compiled > g++32 on 4-STABLE, I don't get warnings at all, no matter if -pedantic is > specified or not. > > So here's the questions for the experts: > > - Why errors instead of warnings? > - Why do gcc's own bits seem to not conform to some kind of standard that it > tries to adhere to in 5-CURRENT but not in 4-STABLE? > - Who's to blame? I haven't looked recently, but I seem to recall that the STL and other C++ header bits that we install in /usr/include are from an older GCC release than the compiler. On my pre-GCC 3.3 -CURRENT system: System compiler: % g++ -c -Wall -pedantic hello.cc GCC 3.2 from ports: % g++32 -c -Wall -pedantic hello.cc GCC 3.3 from ports: % g++33 -c -Wall -pedantic hello.cc I also recall lots of missing `typename's in the system headers that were resolved in the actual GCC distribution. Alexander, do the STL headers et. al. get updated with the rest of the compiler chain? Cheers, -- Jacques Vidrine . NTT/Verio SME . FreeBSD UNIX . Heimdal nectar@celabo.org . jvidrine@verio.net . nectar@freebsd.org . nectar@kth.se