[Bf-committers] unused function args & warnings.

Campbell Barton ideasman42 at gmail.com
Wed Oct 13 05:16:15 CEST 2010


Id like to enable warnings in GCC for unused args, however this gives
a lot of warnings for functions which have args which are needed so
the function can be used as a callback.
This would only apply to C code in blender's source/ and intern/ dirs,
since it doesn't make sense to modify external libs for this.

We could have a #define for UNUSED() as described here.
http://sourcefrog.net/weblog/software/languages/C/unused.html

this way a function will have UNUSED added like this...
void fmod_envelope_addpoint_cb (bContext *C, void *fcm_dv, void *UNUSED(dummy))

While its a ugly to have UNUSED() in with the function args also makes
it clear that its intentionally unused and makes sure when arguments
become unused that a developer can see why and possibly remove it.

Writing to the list because this would end up changing many files in
blender which I don't maintain.
-- 
- Campbell


More information about the Bf-committers mailing list