[Bf-committers] new round of warning hunt : some goofy things i cant decide on

Jean-Luc Peuriere jlp at nerim.net
Sat Jun 4 21:54:44 CEST 2005


Le 4 juin 05, à 13:29, Vio a écrit :

> Duh. I've heard somewhere that *casts* is a way to cheat the compiler, 
> but then again, if you
> want your code to compile, what other choice is there (besides hacking 
> the offending sources)?
> I personally find signed/unsigned keywords more annoying than anything 
> else, but then again,
> I'm just a clueless newbie. I guess coding style may play a little 
> here.
> By the way, if using gcc, you may find the "-w" flag useful in such 
> situations

It's not cheating, but insuring that the compiler do what is needed. Of 
course, doing this kind
of promotion manually means that you are on your own and must 
understand exactly what is
needed.

the warnings about promotions or casts are issued only when you are 
outside of the explicit rules
of the language, and different compilers may have different ideas about 
what to do. casting is then
the only way to insure it is ok for cross-platform stuff.

-w alone is useless as it will report duty fully the unused parameters 
of functions which in the case of
blender leads to warnings in the 1000s. -W -Wno-unused-parameter is ok 
but will report too much,
i think

for blender, the best set i have found so far is :

   -Wall -Wno-char-subscripts -Wno-missing-braces -Wmissing-prototypes

adding -Wsign-compare helps too

btw, if someone knows the flag(s) so that gcc reports commas at end of 
lists or enums (which is not
legal std89 C but a common extension and enabled by defaut in GCC), i 
could not find it.
-- 
Jean-Luc



More information about the Bf-committers mailing list