| Author |
Topic  |
|
|
foxmuldr
Tomato Guru
    
USA
435 Posts |
Posted - Nov 04 2025 : 2:52:25 PM
|
I've just started using Code Inspection today, and there are some aspects I have questions on.
1. I have an [#include "..\libsodium\include\sodium.h"] include file, which is used multiple places in my source file. But I see the message pop up: "Included header ..\libsodium\include\sodium.h is not used directly". What does that mean? The sodium.h file only has lots of #include files within, so does it mean that there's no direct content in my source file that references things explicitly defined there in the sodium.h file, and not in the multiple #include files it contains?
2. I have a [crypto_kx_PUBLICKEYBYTES] value that is declared in one of the libsodium files, and when I use that in a local variable I've declared to allocate the correct number of bytes I see the message: "Warning: no header providing 'crypto-kx-PUBLICKEYBYTES' is directly included". What does that mean? Because it's buried inside of a sodium.h include, or even another level below that?
3. I have a declaration: [static LRESULT CALLBACK wndProc_function(HWND hwnd, UINT msg, WPARAM wParam, LPARAM);] and I get the message: "Warning: no header providing 'LRESULT' is directly included", and "Warning: no header providing 'WPARAM' is directly included", and the same for LPARAM. What does that mean?
There are a multitude of those similar messages on very common Windows values. Is there a way to turn that warning off? I tried to look for it, but I couldn't see which one it related to by description.
-- Rick C. Hodgin
|
|
|
feline
Whole Tomato Software
    
United Kingdom
19252 Posts |
Posted - Nov 05 2025 : 07:39:00 AM
|
I have just put in a feature request to show the name of the check that is behind a given warning in the tooltip, to make it easier to work out what is going on here:
case=166021
If you show the VA Code Inspection Results window, and then right click on the column headers, you can turn On the column "Checker", which will tell you which checker is behind each result that is being listed for the current file. These are clang-tidy check names, when you come to look them up.
For number 1, it should be coming from the check "misc-include-cleaner", which is described in more detail here:
https://clangd.llvm.org/design/include-cleaner
You can simply disable this check under:
VA Options -> Code Inspection
or you can try the gear icon on this entry, and configure the list of regexes. I added:
stdafx\.h
to this setting, to stop the check from flagging the line:
#include "stdafx.h"
Looks like points 2 and 3 are also coming from the same checker, but here it looks like you will need to either disable the checker, or add a direct include to fix this. To add a direct include, try right clicking on the result in the Code Inspection Results window, and selecting "Apply Selected Quick Fixes" |
zen is the art of being at one with the two'ness |
 |
|
| |
Topic  |
|
|
|