• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: error: invalid use of 'static' in linkage specification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: error: invalid use of 'static' in linkage specification
      • From: Dieter Oberkofler <email@hidden>
  • Prev by Date: Re: Xcode 3.1.3 -- (not) stepping into
  • Next by Date: Re: No UNIX Development Tools on Snow Leopard
  • Previous by thread: error: invalid use of 'static' in linkage specification
  • Next by thread: Re: error: invalid use of 'static' in linkage specification
  • Index(es):
    • Date
    • Thread