cppcheck-vs-addin icon indicating copy to clipboard operation
cppcheck-vs-addin copied to clipboard

Inherited project settings are not used.

Open Altren opened this issue 10 years ago • 8 comments

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.

Altren avatar Mar 07 '14 14:03 Altren

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....

Altren avatar Mar 07 '14 14:03 Altren

Mind if I'll add option to either use project only includes or use full paths?

Altren avatar Mar 07 '14 14:03 Altren

Also I can't find a way to get full preprocessor definitions list.

Altren avatar Mar 07 '14 15:03 Altren

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.

VioletGiraffe avatar Mar 07 '14 18:03 VioletGiraffe

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. preprocessor 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).

Altren avatar Mar 08 '14 00:03 Altren

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.

Kosta-Github avatar Mar 08 '14 20:03 Kosta-Github

I absolutely agree.

VioletGiraffe avatar Mar 08 '14 20:03 VioletGiraffe

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.

Altren avatar Mar 08 '14 22:03 Altren