On Oct 14, 2008, at 03:54, Mark Phalan wrote:
>> I think you can shutoff lint warnings with /* LINTED */ for next line
>> and might be doable for a chunk of code (see docs.sun.com for full
>> list), did u consider that approach?
>
> Thats what I tried at first. The problem is that sometimes the  
> functions
> *are* used so lint will complain about unused lint directives :) I  
> think
> generally speaking putting static funcs in header files is a bad  
> idea as
> far as lint is concerned.

How about:

/*LINTED MIT code conventions use possibly-unused inline functions in  
headers*/
inline int  
silly_unused_function_to_silence_lint_on_possibly_unused_inline_functions 
(int x, void *p) {
   return load_16_be(p)
          + load_32_be(p)
         /* ... */ ;
}


Now load_16_be and friends are always referenced, and the function  
with the lint directive is always unused. :-)

I think I've said, the "static"-ness of the functions is less  
interesting than the "inline"-ness, lack of multiple-definition or  
undefined-function errors, etc.  If there's a declaration/annotation/ 
whatever for these functions that works for Sun cc and lint as well as  
for gcc, I'm happy to use them.

Ken

Reply via email to