[ODE] Warnings from compiling ODE. What to do?

Klaus Backert Klaus.Backert at t-online.de
Sun Sep 10 15:17:44 MST 2006


Hi,

I have compiled and linked ODE 0.6 as a static library successfully  
with Mac OS X 10.4.7, Xcode 2.4, gcc 4.0. Out of paranoia and  
curiosity I set a lot of gcc warning flags, e.g. -Wreturn-type - 
Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused- 
label -Wunused-parameter -Wunused-variable -Wunused-value -Wshadow  - 
Wsign-compare.

I got 442 warnings. Many of them can be ignored, I think. But there  
are some cases, which are more difficult.

Example 1:
blablabla/ode/collision_cylinder_sphere.cpp:205: warning: declaration  
of 'fDepth' shadows a previous local
blablabla/ode/collision_cylinder_sphere.cpp:136: warning: shadowed  
declaration is here

The variable fDepth, which is declared in an outer block, is  
redeclared in an inner block.

Example 2:
blablabla/ode/collision_quadtreespace.cpp: In member function 'void  
Block::AddObject(dxGeom*)':
blablabla/ode/collision_quadtreespace.cpp:246: warning: declaration  
of 'Block' shadows a member of 'this'

Inside Block::AddObject there is a statement Block* Block = this; . I  
cannot find any *member* called "Block", only the *class* with this  
name.

There are more examples of this kind. Out of experience I know that  
constructs like these are first class sources of programming errors.

Questions: Can I ignore the warnings? If not, what then?

Cheers
Klaus


More information about the ODE mailing list