I see there are a bazillion compile warnings when I build under Linux/g++/gcc. I'm of the "treat all warnings as errors" school of programming! Is there any problem with me cleaning them up so Bullet bulds cleanly?
Many of them are trivial things like missing newlines on the ends of files, unused variables, switch statements without defaults, variables that might not be initialised.
Some are more serious - virtual classes without virtual destructor functions, order of initialisations of member variables, use of 'char' variables (which, remember may or may not be unsigned) to index into 0..255 arrays. There are some 'static' variables declared in a header file.
Lots and lots and *LOTS* of junk.
Cleanup.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Cleanup.
Hi Steve,SteveBaker wrote:I see there are a bazillion compile warnings when I build under Linux/g++/gcc. I'm of the "treat all warnings as errors" school of programming! Is there any problem with me cleaning them up so Bullet bulds cleanly?
Many of them are trivial things like missing newlines on the ends of files, unused variables, switch statements without defaults, variables that might not be initialised.
Some are more serious - virtual classes without virtual destructor functions, order of initialisations of member variables, use of 'char' variables (which, remember may or may not be unsigned) to index into 0..255 arrays. There are some 'static' variables declared in a header file.
Lots and lots and *LOTS* of junk.
Thanks for offering. It would be good to deal with that indeed. If you can keep the changes fairly minimum, to what you mentioned, please give it a go. Just to avoid potential conflicts etc.
Please leave the interfaces, methods and names and other coding style issues as they are
Also, it's better not to touch most of the 'Extras' folder. Especially COLLADA_DOM and libxml, but also quickstep and Solid are external, and I prefer not to touch them if not strictly necessary. COLLADA_DOM and libxml give a lot of warnings unfortunately, but they are not really part of the core libraries. Core is Bullet/Bullet and Bullet/BulletDynamics and Bullet/LinearMath.
Thanks,
Erwin
-
- Posts: 127
- Joined: Sun Aug 13, 2006 4:41 pm
- Location: Cedar Hill, Texas
Re: Cleanup.
The changes are individually very simple - but there are a heck of a lot of them!Erwin Coumans wrote: Thanks for offering. It would be good to deal with that indeed. If you can keep the changes fairly minimum, to what you mentioned, please give it a go. Just to avoid potential conflicts etc.
Sure - I'm not trying to improve clarity or style or anything - just to get rid of the dumbest of the warnings so the thing mostly compiles clean.Please leave the interfaces, methods and names and other coding style issues as they are ;-)
Those two actually compile fairly cleanly already. LibXML is horrible inside - really ugly coding - but the only warnings I get about it are complaints about pointer aliassing problems that are not at all easy to fix. In fact, those are probably the only warnings that aren't trivial to fix.Also, it's better not to touch most of the 'Extras' folder. Especially COLLADA_DOM and libxml,
I'll try to commit something later tonight.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
-
- Posts: 127
- Joined: Sun Aug 13, 2006 4:41 pm
- Location: Cedar Hill, Texas
OK - I've committed that set of changes.
There are still a few warnings, in Extras/LibXML there are about a dozen occurrances of:
The other problem I couldn't see how to fix is that most of the demos link with a cryptic message:
There were quite a few cases where unused variables were initialised from external function calls - the compiler can't optimise those out because it doesn't know whether they have side-effects or not. In terms of realtime performance, it's quite important to clear these out as you work.
There are still a few warnings, in Extras/LibXML there are about a dozen occurrances of:
...it's not easy to see how to fix these - the code in libXML is really ugly - employing every nasty coding trick in the book, there are also files with 20,000 lines of source code in one file!!warning: dereferencing type-punned pointer will break strict-aliasing rules
The other problem I couldn't see how to fix is that most of the demos link with a cryptic message:
Anyway - I got rid of over 500 warning messages - so this is much better than it was./usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld: `.L244' referenced in section `.rodata' of ./out/linuxx86/optimize/libs/libbullet.a(BoxShape.o): defined in discarded section `.gnu.linkonce.t._ZNK8BoxShape16GetPlaneEquationER11SimdVector4i' of ./out/linuxx86/optimize/libs/libbullet.a(BoxShape.o)
There were quite a few cases where unused variables were initialised from external function calls - the compiler can't optimise those out because it doesn't know whether they have side-effects or not. In terms of realtime performance, it's quite important to clear these out as you work.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
-
- Posts: 127
- Joined: Sun Aug 13, 2006 4:41 pm
- Location: Cedar Hill, Texas
I didn't have to touch any of the COLLADA files - they all compiled 100% clean out of the box.
There was just two changes I made to LibXML. schematron.c contains two unused static functions that I commented out. It's not the end of the world if that gets overwritten in a subsequent release...but I'll fling a complaint to the libXML guys.
All of the other changes were in Bullet files.
There was just two changes I made to LibXML. schematron.c contains two unused static functions that I commented out. It's not the end of the world if that gets overwritten in a subsequent release...but I'll fling a complaint to the libXML guys.
All of the other changes were in Bullet files.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
by the way, on the libxml thing, I think I removed some files that I considered not useful, perhaps that caused the warning.
I wanted an easy compile-out-of-the-box libxml, working under Linux, windows, Mac etc. I had to cheat, and run 'configure' and provide a config_win32.h and a config.h for non win32. For other exotic platforms, you can still re-run configure in the libxml folder.
I wanted an easy compile-out-of-the-box libxml, working under Linux, windows, Mac etc. I had to cheat, and run 'configure' and provide a config_win32.h and a config.h for non win32. For other exotic platforms, you can still re-run configure in the libxml folder.