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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

1,374 Views
_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

Labels (1)
0 Kudos
1 Reply

597 Views
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 Kudos