On Tue, Aug 07, 2001 at 02:51:21PM -0700, Peter Jay Salzman wrote:
> does anyone know what this error message means:
> 
> % lclint calc2.c 
> LCLint 2.4b --- 18 Apr 98
> 
> calc2.c:3:8: Function exported but not used outside calc2: add
>   A declaration is exported, but not used outside this module. Declaration
>   can use static qualifier. (-exportlocal will suppress message)
>    calc2.c:45:1: Definition of add
> 
> Finished LCLint checking --- 1 code error found
> 
> 
> thanks,
> pete

I believe it's saying that the function has external linkage, but
doesn't seem to be used from within some other foo.c, so the external
linkage is unnecessary, in which case you should consider switching to
internal linkage (via the use of the "static" keyword).

If the error doesn't apply to your case (only checking one file at a
time, building a library, etc.), you should silence the warning.  Most
lint programs need to be "tuned" to your specific needs.

FWIW, someone on comp.lang.c recently was complaining that lclint
complains about things it shouldn't, and doesn't complain about things
it should (not that lint is topical for c.l.c.)...  I haven't had a
chance to evaluate it yet.

Micah

Reply via email to