Thanks for the fixes. I've applied them all, though I changed some of them to do things differently. See the notes below.
@Matt - If you read this, is is possible to get the CDash nightly builds to use the '-Wall -Wextra' parameters? That way we can stop these warnings coming back in the future.
HolgerSchurig wrote:
glew.cpp contains a check "glXGetClientString == NULL". However, this can never be the cast, as this is defined in glew.h as "extern const char* glXGetClientString (Display *dpy, int name);". g++ 4.6 warns "can never be NULL".
I've changed these, though glew.cpp isn't actually our code. It's from
http://glew.sourceforge.net/. You could let them know, and we'll also try to remember this change when we update in the future.
HolgerSchurig wrote:
I also noticed that there are 4 identical glew/ subdirectories now in the code base.
Yep, this is getting a bit silly now... I need to factor out some common code into an example framework.
HolgerSchurig wrote:
examples/Paging/main.cpp: the callback function unload() doesn't use the parameter "vol". "Q_UNUSED(vol)" or "(void)vol" will make the compiler not spit out an unused parameter warning.
Rather than using your '(void)variable_name' trick I've changed the function declaration by commenting out the variable name:
Code:
void unload(const ConstVolumeProxy<MaterialDensityPair44>& /*vol*/, const PolyVox::Region& reg)
This is a user-supplied function though, and in the general case the first parameter might be required. But let me know if this doesn't actually fix the warning.
I've done the same for some other unused variables you identified, and some I've removed completely. In the case of the MeshDecimator it's just a mess anyway - large parts of that need deleting as it is now handled inside the CubicSurfaceExtractor.
HolgerSchurig wrote:
library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl: directly at the end of a for loop there's the code "Block<VoxelType>* block = getUncompressedBlock(x,y,z);". This produces an unused variable warning. I haven't looked if getUncompressedBlock() is called because of a side effect or not. If not, then this line can vanish. In the other case, the "Block<VoxelType>* block =" can vanish. If this produces a warning on other compiler, then "(void) getUncompressedBlock(x,y,z)" can be used, probably with a comment to hint to the side-effect.
Yep, getUncompressedBlock() does have important side effects, but I've removed the assignment.
I'll make this thread as fixed, but it's probably work having a sticky thread for people to post things like this. I'll set one up. Also, I applied these changes by hand so let me know if I missed anything.
[Edit:] I created such a thread
here