I believe I've got PC-Lint installed OK as per the Keil instructions, but on Linting my source it seems all the system sfr & sbits are being flagged up, eg :
"Error 40: Undeclared identifier 'ADCON'"
along with TMOD, TH0, TL0, EAL, ET0, P1, P3, P4...
These are resolved for the compiler by a
#include <reg515c.h>
Keil include file with SBIT and SFR definitions in. Lint doesn't seem to be seeing them though.
Does anyone have any pointers for me for how to fix this?
Much as with include paths, you need to define preprocessor symbols for lint as you do for your compiler.
Usually, I take care of this chore in the build tool (jam, make, whatever you like). Ideally your project build system lets you list the symbols and can wrap them in appropriate syntax for various tools like the compiler and lint.
Another strategy is to create an "project.h" which includes all the #defines that select options for the project, and have all header files include that first, so that the options can affect those headers. Then there's one common place to adjust the options that's not the command line of the various tools.
In general, I prefer to avoid conditional compilation in the first place; This is one of the reasons why.