When I run PC-Lint on my code on IAR Workbench it conflicts with a code snippet present in library header file yvals.h which I am including below and then PC-Lint stops working.
/* IAR compiler version check */
#if (__IAR_SYSTEMS_ICC__ < 9) || (__IAR_SYSTEMS_ICC__ > 9)
#error "DLib compiled with wrong (version of IAR) compiler"
#endif
The version of IAR compiler that I am using is co-iar.lnt. I chose this compiler version from PC-Lint config file.
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 underProject > Options > Compiler > Extra Options. Once you compile your project the fileiar_symbols.his generated. Afterwards you can remove the--predef_macrosoption 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.hheader for each compiler version.