Avi Stiefel
Avi Stiefel

Reputation: 33

How can I make visual c++ 2010 recognize the declaration "_extension"

While compiling a Visual Studio 2010 program, I included the python2.5 directory. In the file _types.h, there is the code:

#ifndef __off64_t_defined
__extension__ typedef long long _off64_t;
#endif

with the error on extension:

this declaration has no storage class or type specifier.

What is wrong?

Upvotes: 3

Views: 967

Answers (2)

kichik
kichik

Reputation: 34734

To quote GCC manual:

   `-pedantic' and other options cause warnings for many GNU C
extensions.  You can prevent such warnings within one expression by
writing `__extension__' before the expression.  `__extension__' has no
effect aside from this.

I'd say it's safe to simply ignore it for VC2010. So just define it as nothing.

#define __extension__

Upvotes: 2

sje397
sje397

Reputation: 41852

Whithout knowing more, I can't guess what side effects this might have, but you could try:

#define __extension__

This will make the pre-processor replace all occurrences of the word with nothing.

But this is likely due to a missing include file that defines this for a reason. Perhaps you are including a header that is meant for internal use? Maybe there is another header that includes this one and also the missing definition that you could use instead.

Upvotes: 0

Related Questions