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: <xyz.h> is not used directly
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

azur
Ketchup Master

Germany
65 Posts

Posted - Nov 12 2026 :  04:28:33 AM  Show Profile  Reply with Quote
How can I suppress a specific message?
In my case: "included header stdafx.h is not used directly"
I don't want to suppress the hole 'misc-include-cleaner' because it's helpful.

feline
Whole Tomato Software

United Kingdom
19423 Posts

Posted - Nov 12 2026 :  08:11:07 AM  Show Profile  Reply with Quote
Easy if you know how Consider the following two lines:

#include <set>
#include <vector> // vaCI:skip:misc-include-cleaner - skip the single check "misc-include-cleaner" for this single line


by default both are being flagged by project wide code inspection. The comment disables this single check on this single line.

This is documented here:

https://wholetomato.fogbugz.com/f/page?W760

and you can do quite a few other things, but personally I favour this approach, since it keeps the skipped checks as small and narrow as possible, to make sure you aren't accidentally turning off code inspection across entire functions or files.

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

azur
Ketchup Master

Germany
65 Posts

Posted - Nov 13 2026 :  03:23:58 AM  Show Profile  Reply with Quote
Thanks, that helps me in this specific case.
However, I have another issue. I have an `xxx.h` file with:
namespace a::b::c {
void hallo();
}

namespace a::b {
void test();
}

In an implementation file, I have:

#include "xxx.h"
...
a::b::test();
...

In this instance, I also get the "misc-include-cleaner" warning.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19423 Posts

Posted - Nov 13 2026 :  11:45:24 AM  Show Profile  Reply with Quote
I am testing with VS2022 and VA 2636 under Windows 11, in case this matters.

I don't think I have the right test for your second problem. I have started with a simple C++ 17 console solution. Compiling as C++ 17 since I don't know if you have previously defined the namespaces individually or not.

In the header file "code_inspect_namespace_test.h" I have:


namespace FELINE::BLAZE::TESTING_DEEP
{
	void testFunctionThreeSpacesDeep() { }
}

namespace FELINE::BLAZE
{
	void testFunctionTwoSpacesDeep() { }
}

this is the first, and only place that these namespaces are declared.

In the main cpp file I have:

#include "code_inspect_namespace_test.h"

int main()
{
    FELINE::BLAZE::testFunctionTwoSpacesDeep();
    void *pSimplePtr = NULL;

    std::cout << "Hello World!\n";
}


Code Inspection is only picking up NULL should be nullptr. Nothing for the #include statement.

If you have a small code sample you are able to send me, you can email me at [email protected], no need to post anything publicly. Any code would be treated as confidential, and only used to pin down the bug. Not sure if this helps or not, but worth saying in case it does help.

zen is the art of being at one with the two'ness
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000