Author |
Topic |
|
alex.postlethwaite
Senior Member
39 Posts |
Posted - Mar 24 2017 : 11:38:29 AM
|
Hi,
We are using C++ Shared Items Projects (https://blogs.msdn.microsoft.com/vcblog/2015/07/30/cross-platform-code-sharing-with-visual-c/) to shared code between multiple projects.
We don't seem to get code inspection results from files contained in the Shared Project.
From another thread, I enabled logging and looking at VaCodeInspections.log.
When opening files that fail to analyse, I see these messages:
----
ERROR: Exception: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)) Callstack = at EnvDTE.ConfigurationManager.get_ActiveConfiguration()
at dv.c(ITextBuffer A_0)
----
Is it possible for it to work for these projects?
Please see an attachment exhibiting this issue.
If you open App1.cpp or App2.cpp you can see an issue regarding 0 -> nullptr change.
If you open SharedHeader.h, the same code exists, but analysis does not complete.
Thanks, Alex |
Edited by - alex.postlethwaite on Mar 24 2017 11:40:23 AM |
|
alex.postlethwaite
Senior Member
39 Posts |
Posted - Mar 24 2017 : 11:39:54 AM
|
Just realised I can only attach images.
Do you need the example or do you have enough information?
Thanks, |
|
|
holedigger
Whole Tomato Software
145 Posts |
Posted - Mar 24 2017 : 3:05:04 PM
|
Hi Alex, thanks for reporting this. I think that's enough info for me to investigate, but I'll let you know if I need anything more. |
Whole Tomato Software |
|
|
holedigger
Whole Tomato Software
145 Posts |
Posted - Mar 24 2017 : 4:54:54 PM
|
I've managed to reproduce the problem, and I've opened a bug report case=104861. |
Whole Tomato Software |
|
|
alex.postlethwaite
Senior Member
39 Posts |
Posted - Mar 27 2017 : 06:43:15 AM
|
quote: Originally posted by holedigger
I've managed to reproduce the problem, and I've opened a bug report case=104861.
Great, thanks.
Due to the way shared items projects work, I can imagine a situation where the code analysis returns different results depending on the configuration of the project that the shared code is being referenced by (e.g. macro in AppA but not in AppB).
If possible, I suppose I'd like to see all possible issues (which might require parsing the file several times).
If the ambiguity about which configuration caused the defect needs to be visible, a Project|Config column in the inspection results window could work.
Or maybe you've already got a neat way of solving it, either way, look forward to a fix as we have a significant amount of our shared code in these kinds of projects now. |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Apr 26 2017 : 5:04:03 PM
|
case=104861 is fixed in build 2217. |
|
|
holedigger
Whole Tomato Software
145 Posts |
Posted - Apr 26 2017 : 5:55:22 PM
|
Code Inspection currently honors the active configuration (eg, Debug|Win32), as well as the active shared project context in the VS Navigation bar. |
Whole Tomato Software |
|
|
|
Topic |
|