Faisal Kabariti
Faisal Kabariti

Reputation: 43

Compiler doesn't recognize __STATIC_INLINE

I have a C project which was running on ARM architecture using the arm-none-eabi-gcc compiler and now I am trying to compile it natively on windows using the gnu99 compiler because I need to unit test and it was difficult to do it on the actual hardware.

However the compiler is not recognizing the static inline commands although i included the inline flag in my makefile, as follows: CFLAGS += -fgnu89-inline

Below is the error i am getting:

error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void' __STATIC_INLINE void

Does anyone have an idea on how to let the compiler recognize the inline commands?

Upvotes: 3

Views: 7262

Answers (3)

Riscy
Riscy

Reputation: 915

Check CMSIS, they have these statements in there.

#define __STATIC_INLINE static inline

Upvotes: 0

natersoz
natersoz

Reputation: 1752

I am guessing that in some header file there is a line of code that looks like this:

#define __STATIC_INLINE static inline

The motivation for this ugly hack is to preserve pre-C99 compatibility. This #define is probably getting removed based on the platform you are compiling on. Cross compiler versus PC platform.

I would work on removing this type of nonsense as the code evolves.

Upvotes: 0

David Grayson
David Grayson

Reputation: 87426

The name __STATIC_INLINE is not a part of standard C. You either need to provide a macro definition for it, or you should replace __STATIC_INLINE with static inline.

Upvotes: 6

Related Questions