The IAR compiler internally defines various preprocessor symbols (like __IAR_SYTEMS_ICC
) which are not known by PC-Lint in your setup. Fortunately you can instruct the IAR compiler to generate a file with all theses symbols using the command line option --predef_macros iar_symbols.h
. You can add this option in any Embedded Workbench project under Project > Options > Compiler > Extra Options
. Once you compile your project the file iar_symbols.h
is generated. Afterwards you can remove the --predef_macros
option from your project again.
Now you need to instruct PC-Lint to read the generated file by adding the option -header(iar_symbols.h)
to your PC-Lint command line. This should resolve your issue.
Note that the list of pre-defined symbols depends on the compiler version used. If you use different IAR compiler versions for different projects you should generate one iar_symbols.h
header for each compiler version.