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: Dieter Oberkofler <email@hidden>
- Date: Thu, 17 Sep 2009 09:09:46 +0200
Sure, but extern "C" is a linkage specification needed to link with C
code from a C++ application and this "should" be valid!
-D
On 17.09.2009, at 07:49, Greg Guerin wrote:
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
_______________________________________________
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