CW 5.9.0 SE Inlining functions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CW 5.9.0 SE Inlining functions

Jump to solution
890 Views
AirDragon
Contributor III

I stumbled across the INLINE pragma and managed to get it working, but I 'm still wondering why a simple:

 

inline void myfunc( void );

 

wouldn't work?

Labels (1)
0 Kudos
1 Solution
605 Views
CrasyCat
Specialist III

Hello

 

Compiler delivered on CW 5.9.0 implements the ISO/IEC 9899:1990 (also known as c90 ANSI C standard.

 

In this standard inline is not a valid keyword for ANSI C language. It is only recognized when you are programming in C++.

 

CrasyCat

View solution in original post

0 Kudos
7 Replies
605 Views
bigmac
Specialist III

Hello,

 

What you have is not correct usage for a pragma.  The correct usage -

 

#pragma INLINE

void myfunc( void)

{

...

}

.

Regards,

Mac

 

0 Kudos
605 Views
AirDragon
Contributor III

Well, yes, that's what was working for me.

 

But I was asking why just using the inline declarator wouldn't work? I keep getting "missing decl" errors.

0 Kudos
605 Views
bigmac
Specialist III

Hello,


AirDragon wrote:

But I was asking why just using the inline declarator wouldn't work? I keep getting "missing decl" errors.



Perhaps this is because "inline" is not a valid keyword or typedef.

 

Regards,

Mac

 

0 Kudos
606 Views
CrasyCat
Specialist III

Hello

 

Compiler delivered on CW 5.9.0 implements the ISO/IEC 9899:1990 (also known as c90 ANSI C standard.

 

In this standard inline is not a valid keyword for ANSI C language. It is only recognized when you are programming in C++.

 

CrasyCat

0 Kudos
605 Views
AirDragon
Contributor III

Huh, ok. That's wierd because I thought I saw the "inline" definition in ISO/IEC 9899... I'll have to look at it again to see whats going on.

 

Many thanks, bigmac and CrasyCat.

0 Kudos
605 Views
CrasyCat
Specialist III

Hello

 

  Keyword inline has been added to the ISO/IEC 9899:1999 (also named c99) standard.

 

  But compiler on CW 5.9 does not implement that version of the standard.

 

CrasyCat

0 Kudos
605 Views
AirDragon
Contributor III

Well that explains things rather nicely, Lol.

 

Thanks again.

0 Kudos