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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,927 次查看
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,245 次查看
marcbunyard
Contributor IV

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

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,245 次查看
BlackNight
NXP Employee
NXP Employee

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

0 项奖励
回复
2,245 次查看
marcbunyard
Contributor IV

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

0 项奖励
回复
2,246 次查看
marcbunyard
Contributor IV

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

0 项奖励
回复
2,245 次查看
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 项奖励
回复