Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Code Inspection and .cxx files
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 05 2017 :  10:12:41 AM  Show Profile  Reply with Quote
Visual Assist = 2223
Visual Studio = 2015


Hi,
my solution contains .h and .cxx files. The new Code Inspection feature will display issues found in .h files but will not show anything in .cxx files. Is there something I need to do to enable this?
Thanks,
Patrick

accord
Whole Tomato Software

United Kingdom
3103 Posts

Posted - Jul 05 2017 :  12:33:49 PM  Show Profile  Reply with Quote
I think that the following should help you with that:
https://docs.wholetomato.com/default.asp?W328
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 07 2017 :  08:33:50 AM  Show Profile  Reply with Quote
Hi,
I followed the steps in the link as above but I still don't see any code inspection suggestions in my .cxx files. It is a large solution but even if I open a small file there is nothing to see when I intentionally write code which should be detected for improvement. Is there anything else I should do?
Thanks,
Patrick
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 07 2017 :  11:19:22 AM  Show Profile  Reply with Quote
Are you seeing any sign that VA is active in these files? Are the VA context and navigation fields showing at the top of the editor window? What about VA colouring, and VA Outline?

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 10 2017 :  07:52:16 AM  Show Profile  Reply with Quote
In the .cxx files, the VA navigation bar, VA colouring and VA outline are all working as expected. This has always been the case without needing to make any of the tweaks as documented in your link. However, VA code inspection still does not get shown in the .cxx files while it does get shown in the .h files.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 10 2017 :  11:10:01 AM  Show Profile  Reply with Quote
I had forgotten that .cxx is a standard and supported file extension for C++ in VA, sorry about that.

I have added the following simple test function to a .cxx file, using VS2015 and VA 2223:
void simpleCxxTestWithVoid(void)
{

}

and VA code inspection is picking up the redundant void parameter perfectly happily for me. Are you seeing any results at all in the Code Inspection Results window, when you open it?

What happens if you add this simple test case to your .cxx file?

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 10 2017 :  12:16:58 PM  Show Profile  Reply with Quote
If I add the redundant void to the .h file, VA code inspection immediately detects it. In the .cxx file, it also finds it! However, if the method is a member of a class then it is not detected. Please see examples below.

.h

void simpleCxxTestWithVoid1(void) {} //detected

class SomeClass
{
...
void simpleCxxTestWithVoid2(void); //detected
void simpleCxxTestWithVoid3(void) {} //detected
};

//

.cxx

void simpleCxxTestWithVoid4(void) {} //detected
void SomeClass::simpleCxxTestWithVoid2(void) {} //not detected
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 10 2017 :  1:43:01 PM  Show Profile  Reply with Quote
Have you added the #include for the header file where the class declaration lives to your .cxx file?

Both lines are being detected for me, in both the .h and the .cxx file.

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 10 2017 :  1:47:31 PM  Show Profile  Reply with Quote
Hi, yes the #include is correctly present. We have a large solution, it seems that all VA features work everywhere except for code inspection in classes saved in .cxx files. If I get a chance I will do some testing here but this scenario has been the case ever since code inspection was first announced.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 10 2017 :  1:50:16 PM  Show Profile  Reply with Quote
Classes saved or declared in .cxx files?

Are you using .cxx files as .cpp files, files for implementations, or as header files? In VA's registry settings we are expecting .cxx files to be equivalent to .cpp files. So I am wondering if treating .cxx files as header files could be a clue here?

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 10 2017 :  2:01:51 PM  Show Profile  Reply with Quote
We treat .cxx files as .cpp files. Someone many years ago decided to rename them. It is a typical C++ source file saved with the .cxx extension.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 10 2017 :  4:22:50 PM  Show Profile  Reply with Quote
If you have the time, can you please try creating a new project, and see if you see the same problem with Code Inspection and .cxx files there? So far I cannot reproduce this effect, so I am wondering if the file extension is really a factor, or if instead something else in your solution might be involved.

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 11 2017 :  10:51:16 AM  Show Profile  Reply with Quote
I created a sample Visual Studio console solution containing .h, .cpp and .cxx files and was able to view code inspection issues in all three file types. Is there some sort of logging or debugging I can use to find out what is happening then with my solution?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 11 2017 :  12:13:51 PM  Show Profile  Reply with Quote
Can you try copying one of the .cxx files from your main solution, where Code Inspection is not picking up issues, and add it to your test solution? I am wondering if Code Inspection now works correctly, or if it is still missing things. It could be something about the files themselves, one of the include files, or the solution settings. Hopefully this will help to narrow this down.

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 11 2017 :  12:50:44 PM  Show Profile  Reply with Quote
I added a low level file from my code to the sample solution. Using the same code as in post 7, in the sample solution all code inspection issues are detected. In my own solution, in the .cxx file
void SomeClass::simpleCxxTestWithVoid2(void) {}
fails to be detected.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 11 2017 :  2:41:19 PM  Show Profile  Reply with Quote
That is interesting, thank you for the update. At least now we can be sure that the problem isn't the .cxx extension, or the code its self. Now we just need to try to figure out where the problem is coming from.

Can you please try commenting out all of the #include statements in this .cxx file in your main solution, and see if this has any effect?

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 13 2017 :  06:19:17 AM  Show Profile  Reply with Quote
I commented out all #includes in both the .cxx file and the .h file in my main solution, then enabled them line by line. At all times
void SomeClass::simpleCxxTestWithVoid2(void) {}
failed to be detected.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 13 2017 :  12:17:50 PM  Show Profile  Reply with Quote
Are you able to test the exact same .cxx file in both your main solution and the small test solution? It almost sounds like there is something about the syntax in the file that is tripping up Code Inspection.

If you have already tested the exact same file, does the file contain any pre-processor commands? I am mainly interested in #if or #ifdef statements, something that we can expect to be treated differently in the two solutions.

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 17 2017 :  11:50:42 AM  Show Profile  Reply with Quote
I believe I have found something of interest. I placed the exact same file in both solutions. When adding the file to the test solution the #include file location was invalid, so I force made it the absolute file path ie
#include "C:/.../blah.h"
This allowed code inspection to work in the test solution.
In my real solution, that same file uses relative addressing ie
#include "path/to/blah.h"
What I noticed though is that in "C/C++ -> General -> Additional include directories", the rest of the path to resolve this file location is entered as
"..\..\..\..\libs"
If I change the slashes to
"../../../../libs"
then code inspection does finally work in my real solution. I would guess then that the slash direction must need to be normalised somewhere in code inspection?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 17 2017 :  3:43:44 PM  Show Profile  Reply with Quote
It seems odd that the type of slash would cause a problem like this, but you have a clear pattern. I have now set up a test solution here, using VS2015 and VA 2223, and I have set the "C/C++ -> General -> Additional include directories" to the two paths:

../../../../../libBack;..\..\..\..\..\libs

so I can check both types of slash in one project. I have also tried this with a .cpp and .cxx file including header files from both of these library directories. I am not seeing any problems with Code Inspection, the void parameter is being picked up instantly in all of my tests for me. So it's not quite as simple as the slash direction on its own.

Do you have a simple test solution that now shows this problem, that you might be able to send me, along with your IDE and VA settings?

If so, can you please export your VA and IDE settings and send them to me:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

along with the solution. Please submit the files via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Jul 20 2017 :  10:00:36 AM  Show Profile  Reply with Quote
Sorry for not replying sooner. I have been trying to create a simple solution to reproduce the problem but unfortunately have been unable to do so thus far. My large proprietary solution can easily show the problem but I cannot share this. I could let you see it via remote desktop if you wish? I can send you my VA and VS settings but that proabably won't mean much without a sample of the problem. I will be on holiday next week so if you have any updates or anything else I can try, I will do so when I return.
Thanks!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 20 2017 :  11:45:14 AM  Show Profile  Reply with Quote
Not a problem, you have other and more important things to focus on. I have asked our developers if they have any ideas here:

case=109844

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Jul 25 2017 :  1:31:17 PM  Show Profile  Reply with Quote
Good news, we think we have found the problem, and have made a fix that should be included in the next version. None of us have been able to reproduce the problem here, so we are not certain this will fix the issue for you, but we are hopeful.

zen is the art of being at one with the two'ness
Go to Top of Page

sean
Whole Tomato Software

USA
2467 Posts

Posted - Aug 16 2017 :  01:41:57 AM  Show Profile  Reply with Quote
A change has been made for case=109844 in build 2231. Please let us know if build 2231 addresses the issues you were experiencing with Code Inspection.
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Aug 16 2017 :  11:25:52 AM  Show Profile  Reply with Quote
Hi,
I have updated to build 2231. Unfortunately I still have the problem the code inspection does not work in my .cxx files. As I mentioned in an earlier post:

What I noticed though is that in "C/C++ -> General -> Additional include directories", the rest of the path to resolve this file location is entered as
"..\..\..\..\libs"
If I change the slashes to
"../../../../libs"
then code inspection does finally work in my real solution.

I tried this again just now and after changing the direction of the slashes the code inspection then immediately starts working for the .cxx files in that project.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Aug 16 2017 :  12:03:03 PM  Show Profile  Reply with Quote
Can you please try the following steps, so we can try and see what Code Inspection is seeing in this situation.

First open your %TEMP% directory, and then delete all files and folders. This just makes it easier to find the log file, when it is generated.

With your solution include directories using \, so the problem is happening, please close all open code files. Now enable VA logging via:

VA Options -> Performance -> Enable logging

now open the .cxx file where Code Inspection is not working correctly. This will generate the file:

%TEMP%\VaCodeInspections.log

which will tell you the include directories, and other compiler flags that have been picked up and passed to Clang. Can you then close this code file, change the include directory to use /, so Code Inspection works correctly, and generate a new code inspection log file by opening the .cxx file again.

I am interested in how similar, or different, these files are.

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Aug 17 2017 :  05:34:00 AM  Show Profile  Reply with Quote
I have created the files. I opened a .cxx file with two intentional issues:
- a redundant void in a method
- a destructor which could be defaulted
Neither issue is detected. I then opened the corresponding .h file where the default destructor is noticed. Toggling back to the .cxx file the code inspection still does not work. I closed these two files, changed the slash direction in additional includes, then opened the .cxx file where code inspection now starts to work and both issues are detected. Where would you like me to send the log files please?
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
34 Posts

Posted - Aug 17 2017 :  05:38:37 AM  Show Profile  Reply with Quote
Attachments sent.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15375 Posts

Posted - Aug 17 2017 :  10:23:18 AM  Show Profile  Reply with Quote
Thank you for the logs, I have replied via email.

zen is the art of being at one with the two'ness
Go to Top of Page

holedigger
Whole Tomato Software

145 Posts

Posted - Aug 18 2017 :  2:40:50 PM  Show Profile  Reply with Quote
The issue turned out to be caused by quoted paths in the Additional include directories. For example, "c:/foo";"c:/bar". Workaround is to remove the quotes, c:/foo;c:/bar. I've opened case=110439 for this.

Whole Tomato Software
Go to Top of Page

sean
Whole Tomato Software

USA
2467 Posts

Posted - Sep 26 2017 :  11:08:53 PM  Show Profile  Reply with Quote
case=110439 is fixed in build 2235.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2018 Whole Tomato Software, Inc Go To Top Of Page
Snitz Forums 2000