Why are all of my pragmas being ignored as "unknkown"?

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

Why are all of my pragmas being ignored as "unknkown"?

ソリューションへジャンプ
2,951件の閲覧回数
marcbunyard
Contributor IV

I'm using #pragma push / pop / define_section, etc.  and I keep getting

 

ignoring pragma -Wunknown-pragma.  Are they disabled somewhere?

ラベル(1)
1 解決策
2,269件の閲覧回数
marcbunyard
Contributor IV

Thanks for the GCC wake up.  I needed __attribute__ instead of #pragma.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
2,269件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Pragmas depend on the compiler used. So which compiler are you using? gcc? which version?

0 件の賞賛
返信
2,269件の閲覧回数
marcbunyard
Contributor IV

Sorry.  Still messing with this one. CW 10.4 GCC.  I'm new to Code Warrior.

0 件の賞賛
返信
2,270件の閲覧回数
marcbunyard
Contributor IV

Thanks for the GCC wake up.  I needed __attribute__ instead of #pragma.

0 件の賞賛
返信
2,269件の閲覧回数
BlackNight
NXP Employee
NXP Employee

I'm using pragmas like

#pragma pack(push)

#pragma pack(1)

....

#pragma pack(pop)

and that works fine for me. Can you verify that you are using GCC pragmas (and not Keil/IAR ones)?

A useful link could be this one:

Pragmas - Using the GNU Compiler Collection (GCC)

0 件の賞賛
返信