CW 5.9.0 SE Inlining functions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CW 5.9.0 SE Inlining functions

ソリューションへジャンプ
2,139件の閲覧回数
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?

ラベル(1)
0 件の賞賛
返信
1 解決策
1,854件の閲覧回数
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 件の賞賛
返信
7 返答(返信)
1,854件の閲覧回数
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 件の賞賛
返信
1,854件の閲覧回数
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 件の賞賛
返信
1,854件の閲覧回数
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 件の賞賛
返信
1,855件の閲覧回数
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 件の賞賛
返信
1,854件の閲覧回数
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 件の賞賛
返信
1,854件の閲覧回数
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 件の賞賛
返信
1,854件の閲覧回数
AirDragon
Contributor III

Well that explains things rather nicely, Lol.

 

Thanks again.

0 件の賞賛
返信