File static function funcname declared but not used

From 433253

You have three options: the first is to comment out the whole function; This isn't so good, since if you have comments inside the function you'll have to comment around them. The second is to add a splint annotation, /*@unused@*/ in front of the function declaration (or function definition if there's no prototype), as the very first thing on the line. i.e:

/*@unused@*/ void unused_func(int arg);

The last alternative is to comment out the prototype, and then use the pre-processor directives #if 0 and #endif around your function definition, to remove it before compilation. This method will resolve gnuc warnings as well. i.e:

/* void unused_func(int arg); */
#if 0
unused_func(int arg) {
   /*func body*/;


Personal tools