The start08.c code for the MC9S08 generates two warnings.
Unused declaration of function '_COPY_L'
and
Unused declaration of function 'main'
Since this is an analysis warning, the #pragmas don't work? There is a comment above the _COPY_L warning that says
/*lint -esym(752,_COPY_L) inhibit message on function declared, but not used (it is used in HLI) */
How do I use this?
Solved! Go to Solution.
We can use “#pragma OPTION: Additional Options” to "partial " of Compiler throughout code.
Syntax
#pragma OPTION ADD [<Handle>] "<Option>"
#pragma OPTION DEL <Handle>
#pragma OPTION DEL ALL
Description
Options are added inside of the source code while compiling a file.
The options given on the command line or in a configuration file cannot be changed in any way.
Additional options are added to the current ones with the ADD command. A handle may be given optionally.
The DEL command either removes all options with a specific handle. It also uses the ALL keyword to remove all added options regardless if they have a handle or not. Note that you only can remove options which were added previously with the OPTION ADD pragma.
All keywords and the handle are case-sensitive.
You can check more information in Compiler_HC12.pdf under your CW install. Search the document with keyword "pragma OPTION".
For example you want disable warning C4443 . you can use below for the section of code
#pragma OPTION ADD handle "-WmsgSd4443"
<.....your code...>
#pragma OPTION DEL ALL
Hope this helps!
We can use “#pragma OPTION: Additional Options” to "partial " of Compiler throughout code.
Syntax
#pragma OPTION ADD [<Handle>] "<Option>"
#pragma OPTION DEL <Handle>
#pragma OPTION DEL ALL
Description
Options are added inside of the source code while compiling a file.
The options given on the command line or in a configuration file cannot be changed in any way.
Additional options are added to the current ones with the ADD command. A handle may be given optionally.
The DEL command either removes all options with a specific handle. It also uses the ALL keyword to remove all added options regardless if they have a handle or not. Note that you only can remove options which were added previously with the OPTION ADD pragma.
All keywords and the handle are case-sensitive.
You can check more information in Compiler_HC12.pdf under your CW install. Search the document with keyword "pragma OPTION".
For example you want disable warning C4443 . you can use below for the section of code
#pragma OPTION ADD handle "-WmsgSd4443"
<.....your code...>
#pragma OPTION DEL ALL
Hope this helps!
Thank you for responding.
The start08.c code for the MC9S08 generates two warnings.
Unused declaration of function '_COPY_L'
and
Unused declaration of function 'main'
Those are the exact warnings and as you can see there is no CNUM. How do I add the exception for this?
what's the warning message number? or can you please post a screenshot of it?
As you can see. There are no "warning message numbers".
Here is the offending code
/*lint -esym(752,_COPY_L) inhibit message on function declared, but not used (it is used in HLI) */
__EXTERN_C extern void _COPY_L(void);
As you can see there is a comment that says that you can "inhibit message" but I don't know how to add this to lint in codewarrior.
This is the other offending code
/*lint -esym(752, main) main is used in HLI */
__EXTERN_C extern void main(void); /* prototype of main function */
Anyone know how to configure lint in codewarrior?
i can't reproduce your prolem as your screenshot shows. can you please upload your demo project so that we check see the problem directly? thanks!
I started a new project and copied the code over to it and the problem disappeared. Thank you for your help.
I don't want to do this globally. I just want the warnings from freescale's code to go away.
The pragma in below could help to disable a warning message. For details, please refer to Build Tools Reference Manual.
#pragma MESSAGE {(WARNING|ERROR| INFORMATION|DISABLE|DEFAULT){<CNUM>}}
Thank you for your response.
The start08.c code for the MC9S08 generates two warnings.
Unused declaration of function '_COPY_L'
and
Unused declaration of function 'main'
Those are the exact warnings and as you can see there is no CNUM. How do I add the exception for this?
I tried
#pragma MESSAGE WARNING DISABLE
and it had no effect.
Any other ideas?