#pragma MESSAGE WARNING DISABLE C5909 for a few lines.

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

#pragma MESSAGE WARNING DISABLE C5909 for a few lines.

1,139 Views
ssinfod
Contributor IV

Hello,

 

I am using CodeWarrior 5.1 for HCS12.

 

I want to disable a warning message (C5909) for a few lines and then re-enable it.

 

I know that I must use this line to disable it.

#pragma MESSAGE WARNING DISABLE C5909

 

However, I don't know how to re-enable it.

 

        #pragma MESSAGE WARNING DISABLE C5909

        while(*pbuf++ = *s++);

        #pragma MESSAGE WARNING ENABLE C5909       

 

I tried with ENABLE instead of DISABLE but that is not working.

 

Any idea how to perform this ?

Thanks

ssinfod

Labels (1)
0 Kudos
1 Reply

598 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

hi ssinfod,

1. according to Codewarrior compiler manual : This pragma (as other pragmas) has to be specified outside of the function's scope. For example, it is not possible to change a message inside a function or for a part of a function.

2015-03-05_16-22-33.png

pls be aware of this point.

2. use '#pragma MESSAGE DEFAULT C5909 " or "#pragma MESSAGE WARNING" to enable it again.

I attached my demo code, it's for C1420 but the method is the same for C5909.

can this help?


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos