Information, warning or error message when a #pragma is missing?

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

Information, warning or error message when a #pragma is missing?

1,613件の閲覧回数
_hiper_
Contributor I

Hello everyone!   I am using CW V4.6 for HCS12(X)

If I want to move something (const or variable) to GLOBAL memory, I have to put pragmas covering the declaration AND the definition.


If I miss one of this pragmas, I mean, if I put pragmas in the declaration and not in the definition or vice versa, is there any INFORMATION, WARNING or ERROR message that could warn me that that element is not being properly allocated?


Thanks in advance.


Best regards,


hipercadi

ラベル(1)
0 件の賞賛
返信
1 返信

836件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

CW should produce C4200 warning by default:

C4200: Other segment than in previous declaration

[DISABLE, INFORMATION, WARNING, ERROR]

Description

A object (variable or function) was declared with inconsistent segments.

Example

#pragma DATA_SEG A extern int i; #pragma DATA_SEG B int i; 

Tips

Change the segment pragmas in a way that all declarations and the definition of one object are in the same segment. Otherwise wrong optimizations could happen.

0 件の賞賛
返信