I am in need of a C parser which I can use to detect violations of a coding standard. Particularly it must be able to be sensitive to comments (the internals of which are important also) and whitespace, over and above the usual need to be sensible about the rest of the language.
In order to be ideal, it should not need the C to be preprocessed first.
I am not after a syntax checker, after all - the compiler does that for
me. I want to be able to detect things like
is what we mandate in our coding style. However I also want to detect
more complex things such as static functions which lack documentation
comments, or functions which are not declared as
I hope someone has a cunning idea…