Make chc12 ignore a specific pragma

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

Make chc12 ignore a specific pragma

1,023 次查看
jbrynas
Contributor I

Hi,

I have some code that is both built using chc12 for target but also using gcc for unit testing purposes. I need to add some pragmas to the code for the unit testing instrumenter function but then I got a warning when building with chc12 that this specific pragma wasn't handled. Is there a way to tell chc12 to ignore a specific pragma? I don't want to disable the warning since it might be useful to know if a pragma meant for chc12 is misspelled etc.

 

Regards,

标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

842 次查看
kef
Specialist I

You can't make ignoring only specific unknown pragmas, but you can

 

1) temporarily disable unknown pragma warning

#pragma MESSAGE DISABLE C4201

... code with unknown pragmas

#pragma MESSAGE WARNING C4201

 

2) Use CW specific __MWERKS__ define to skip compiling unknown pragmas

#ifndef __MWERKS__

 // some uknown pragmas here

 #pragma ...

#endif

0 项奖励
回复

842 次查看
CrasyCat
Specialist III

Hello

 

No. You can either disable the message for all pragmas or keep it for all of them.

 

CrasyCat

0 项奖励
回复