cppcheck-vs-addin
cppcheck-vs-addin copied to clipboard
Inherited project settings are not used.
Settings, inherited from property sheets are not used during check. Include directories and preprocessor definitions should be added to other includes.
F.e. I use boost propertysheet in all projects to not specify path to boost in each.
From the other hand may be it is better to not include all provided paths or not always do that. Check goes way longer with boost and system paths included....
Mind if I'll add option to either use project only includes or use full paths?
Also I can't find a way to get full preprocessor definitions list.
To the first question: I'm not even entirely sure what you mean. I don't mind, however I like keeping the interface as simple as possible. To the second question: what do you mean? Getting the list from project settings in the add-in code, or something else?
P. S. You'd better not include Boost headers into the check. I haven't tried Boost specifically, but even Qt + Windows headers take ridiculously long on my i5-2500 3.8 GHz CPU. If it wasn't so slow, I would simply check preprocessed files, rather than manage all this mess with the include paths, macros and whatnot.
To the first question: I'm not even entirely sure what you mean. I don't mind, however I like keeping the interface as simple as possible.
Suggested checkbox would be something like "Add all include path to check (including system and inherited from properties sheets)." I don't really need system paths (just can figure how to get inherited properties only, but paths from properties sheets sometimes include my own libraries that are better to be used when checking.
To the second question: what do you mean? Getting the list from project settings in the add-in code, or something else?
There is AdditionalIncludeDirectories for project only includes and FullIncludePath for all includes.
There is UndefinePreprocessorDefinitions for project only definitions, but I can't find property for all definitions.
So current code use those settings above, but sometimes it is necessary to use inherited properties as well (for both includes and preprocessor definitions).
IMHO, the default should be to use the inherited values (includes and definitions). We use >100 projects in our solution and manage the different includes, defines, and lib settings via additional property sheets; if those settings could not be considered for cppcheck it would be a real miss.
Usually you know what kind of headers you would want to ignore for the whole solution (e.g., some system headers, Qt, boost, maybe xerces, ...) and those could/should be disabled by a solution wide config.
I absolutely agree.
Ok, then I'll leave includes as they are now after my last change (all includes path used even "system" paths). The only thing that need to be done in this task is to use all preprocessor definitions. After some research I can't find a way to get those.