Re: error: invalid use of 'static' in linkage specification
Re: error: invalid use of 'static' in linkage specification
- Subject: Re: error: invalid use of 'static' in linkage specification
- From: Greg Guerin <email@hidden>
- Date: Wed, 16 Sep 2009 22:49:04 -0700
Dieter Oberkofler wrote:
I'm having problems with the following error message:
error: invalid use of 'static' in linkage specification
when compiling a like like this: extern "C" static void function
(void);
gcc 4.2.1 seems no longer allowing to specific a C function to be
static.
Is this a gcc bug?
I'm not sure about C++, but in C a function (or variable) can't be
both static and extern. The keyword "static" applied to a function
limits the name to the compilation unit. The keyword "extern"
declares the name as external to the compilation unit. The two
things are mutually exclusive.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden