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

When compiling Visual Studio 2010, I included the python2.5 directory. There is code in the _types.h file:

#ifndef __off64_t_defined
__extension__ typedef long long _off64_t;
#endif

with extension error:

There is no storage class or type specifier in this declaration.

What's wrong?

+3
source share
2 answers

To quote the 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 would say that you can just ignore it for VC2010. So just define it as nothing.

#define __extension__
+2
source

Without knowing more, I can’t guess what side effects this can have, but you can try:

#define __extension__

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

, , include, - . , , ? , , , , .

0

Source: https://habr.com/ru/post/1776233/


All Articles