Experimenting with the gcc4.0.0 compiler
I downloaded/installed a prerelease snapshot of gcc4.0.0 today, and did a clean build with it. I expected it to produce better warnings than 3.4, since 3.4 was more strict than 3.3. And it does! Here is an example:
./xml/node.h:42: warning: ‘class Inkscape::XML::Node’ has virtual functions but non-virtual destructor ./xml/document.h:23: warning: ‘struct Inkscape::XML::Document’ has virtual functions but non-virtual destructor ./xml/sp-css-attr.h:20: warning: ‘class SPCSSAttr’ has virtual functions but non-virtual destructor
The planned release of 4.0.0 is Apr 15, so it would be wise to keep up with developments.
Bob
On Fri, 2005-03-11 at 09:26, Bob Jamison wrote:
I downloaded/installed a prerelease snapshot of gcc4.0.0 today, and did a clean build with it. I expected it to produce better warnings than 3.4, since 3.4 was more strict than 3.3. And it does! Here is an example:
./xml/node.h:42: warning: ‘class Inkscape::XML::Node’ has virtual functions but non-virtual destructor ./xml/document.h:23: warning: ‘struct Inkscape::XML::Document’ has virtual functions but non-virtual destructor ./xml/sp-css-attr.h:20: warning: ‘class SPCSSAttr’ has virtual functions but non-virtual destructor
The planned release of 4.0.0 is Apr 15, so it would be wise to keep up with developments.
Huh. I suppose we can add an empty virtual destructor to Inkscape::XML::Node, but in practice it doesn't really matter, as 1) Inkscape::XML::Node destructors are never called, and 2) Inkscape::XML::Nodes are never deleted using that interface anyway.
(Of course the compiler can't know that.)
-mental
On Fri, Mar 11, 2005 at 08:26:36AM -0600, Bob Jamison wrote:
I expected it to produce better warnings than 3.4, since 3.4 was more strict than 3.3. And it does! Here is an example:
./xml/node.h:42: warning: ‘class Inkscape::XML::Node’ has virtual functions but non-virtual destructor
4.0 may well give better warnings than 3.4, but I don't think that's an example: I've seen these warnings with g++-3.3.
pjrm.
Peter Moulder wrote:
On Fri, Mar 11, 2005 at 08:26:36AM -0600, Bob Jamison wrote:
I expected it to produce better warnings than 3.4, since 3.4 was more strict than 3.3. And it does! Here is an example:
./xml/node.h:42: warning: ‘class Inkscape::XML::Node’ has virtual functions but non-virtual destructor
4.0 may well give better warnings than 3.4, but I don't think that's an example: I've seen these warnings with g++-3.3.
pjrm.
That would be good. But I have been compiling with 3.4+ since September, and I haven't seen these. We really need to make sure that -Wall emits no warnings.
Bob
Bob Jamison wrote:
Blah, blah, droning on endlessly....
By the way, if anyone wants to try a preview snapshot, it is here:
ftp://gcc.gnu.org/pub/gcc/snapshots/LATEST-4.0
How to make it:
tar jxf gcc-4.0-2005mmdd.tar.bz2
cd gcc-4.0-2005mmdd mkdir objdir cd objdir ../configure --disable-shared --enable-languages=c,c++ make > /dev/null [su to root] make install
This will install gcc in /usr/local. --disable-shared will build stdc++ and the others as static, so that your binaries will not have incompatible dependencies on other machines.
To build Inkscape, you will probably need to do a
make clean ; make
...to flush out the old dependencies.
Enjoy.
Bob
participants (3)
-
Bob Jamison
-
MenTaLguY
-
Peter Moulder