Disabling warning C3303: Implicit concatenation of strings

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

Disabling warning C3303: Implicit concatenation of strings

跳至解决方案
2,496 次查看
StevieG
Contributor I

Hi there. I have a need define a lot of strings in my C source that have several hundred characters each, so don't want to have the strings defined all on one line in the source, I want to use string concatenation, eg:

 

#define FORM_TEXT \
  "High Street\n"  \
  "Manchester\n" \
  "Roadway\n"

 

The compiler always warns of there being impiled string concatenation with warning C3303, and the help explains why it does so. The problem I have is that I can't disable this warning at all, the help says that it is generated within the preprocessor so the normal #pragma MESSAGE directive can't be used to disable it. The warning occurs every time a concatenation occurs so I get dozens of them. Is there a way to disable this warning message? Thanks.

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,254 次查看
BlackNight
NXP Employee
NXP Employee

Hello,

you cannot use the pragma as pragmas are not resolved during preprocessing time.

But you can use the compiler option

-WmsgSd3303

to disable the message.

 

BK

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,255 次查看
BlackNight
NXP Employee
NXP Employee

Hello,

you cannot use the pragma as pragmas are not resolved during preprocessing time.

But you can use the compiler option

-WmsgSd3303

to disable the message.

 

BK

0 项奖励
回复
1,254 次查看
StevieG
Contributor I
That works an absolute treat, many thanks for your help.
0 项奖励
回复