Re: gcc-3.3 issues

From: Jacques A. Vidrine (nectar_at_FreeBSD.org)
Date: 07/18/03

  • Next message: Jun Su: "MSDOSFS patch of dirty flag (Darwin Import)"
    Date: Fri, 18 Jul 2003 10:33:58 -0500
    To: Michael Nottebrock <michaelnottebrock@gmx.net>
    
    

    [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 <string>
    > #include <iostream>
    > 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
       <many warnings>

     GCC 3.2 from ports:
       % g++32 -c -Wall -pedantic hello.cc
       <no warnings>

     GCC 3.3 from ports:
       % g++33 -c -Wall -pedantic hello.cc
       <no warnings>

    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
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Jun Su: "MSDOSFS patch of dirty flag (Darwin Import)"

    Relevant Pages

    • Re: Does -O3 enable more warnings than just -Wall -Wextra with gcc?
      ... I don't think gcc invokes that kind of reasoning when deciding ... about it only at a higher optimization level *specifically because the ... the behavior is well defined *by the compiler* at the current ... so one could make a decent argument that shouldn't require warnings when ...
      (comp.lang.c)
    • Re: Is it standard and practical to use long long types?
      ... right option for putting the compiler in conforming mode. ... Bogus/idiotic warnings when all warnings are enabled. ... For reference, this what I get from gcc, when invoked in conforming mode ...
      (comp.lang.c)
    • Re: Is it standard and practical to use long long types?
      ... right option for putting the compiler in conforming mode. ... Bogus/idiotic warnings when all warnings are enabled. ... For reference, this what I get from gcc, when invoked in conforming mode ...
      (comp.lang.cpp)
    • Re: Does -O3 enable more warnings than just -Wall -Wextra with gcc?
      ... I don't think gcc invokes that kind of reasoning when deciding ... rather that appears to be the view that GCC's _programmers_ take. ... the behavior is well defined *by the compiler* at the current ... so one could make a decent argument that shouldn't require warnings when ...
      (comp.lang.c)
    • Re: Whats the story with the "end of XP"?
      ... Support gives them access to the larger body ... The same compiler suite may be "best" in both ... In the case of ByteCraft compilers, you are truly expert in your field, you work closely and rapidly with customers if there are any issues, and you have top class testing and quality control. ... understanding the inner workings of a relatively simple compiler like GCC ...
      (comp.arch.embedded)