l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
April 21: Google Glass
Next Installfest:
TBD
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2001 Dec 30 17:07

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] lclint error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] lclint error?



Disclaimer: I don't use lclint, I would need to try some samples to be
sure this is correct.  I prefer using both "-Wall -W" options to gcc, 
instead.

  What it seems to me to mean is you declared a function which in a file
named "calc2.c" the function is called "add"... most likely you don't
specify "extern" or "static", since the default is extern and perfectly
reasonable.
  Since it was not declared "static" it is available to any other modules 
you link to this file, but none of them actually call "add"... so lclint 
is suggesting that you change from extern to static... or optionally add
the flag "-exportlocal" to get it to shut up.


int foo(int bar);           /* default to extern, callable outside */

static int foo(int bar);    /* callable only inside modules */

extern int foo(int bar);    /* callable outside module */


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
> 
> -- 
> "The following addresses had permanent fatal errors..."      p@dirac.org
>                                -- Mailer Daemon              www.dirac.org/p


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.