[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/blenkernel/intern node_shaders.c

Davide Vercelli davide.vercelli at gmail.com
Fri Dec 15 09:28:21 CET 2006


On 12/12/06, Ton Roosendaal <ton at blender.org> wrote:
>   Bugfix: usage of 2 unitialized variables (again!). I should set gcc to use
>   O2 by default... without O2 it doesnt warn me for it.
[...]
> Fix in outliner code: var declaration on wrong place (gcc won't warn!)

Some useful gcc options:
-Wdeclaration-after-statement
<<Warn when a declaration is found after a statement in a block. This
construct, known from C++, was introduced with ISO C99 and is by
default allowed in GCC.>>

-Wuninitialized
<<Warn if an automatic variable is used without first being
initialized [...]. These warnings are possible only in optimizing
compilation, because they require data flow information that is
computed only when optimizing. If you do not specify -O, you will not
get these warnings. [...] These warnings are made optional because GCC
is not smart enough to see all the reasons why the code might be
correct despite appearing to have an error.>>

Apart from those, since someone claims that blender should use C89 (in
order to be more easily portable, I guess), maybe we should also
compile with the -ansi -pedantic flags, which, among other things,
disable C++ style comments; they won't allow declarations after
statements neither.

UncleZeiv


More information about the Bf-committers mailing list