Header files are not excluded when they do not declare any types
See original GitHub issueIf a file is included in excludedHeaderFiles but doesn’t declare any types or functions, it will not be excluded. This is a problem when the header file is including other header files that do declare types.
A good example of this is windows.h. It doesn’t declare any types itself, but includes quite a few headers that will be visited during ExploreTranslationUnit.
An easy way to replicate the issue is to do the following:
// Library.h
#include "ParentHeader.h"
// ParentHeader.h
#include "ChildHeader.h"
// ChildHeader.h
struct MyStruct
{
int x;
int y;
}
// config.json
{
"inputFilePath": "Library.h",
"outputFilePath": "Library.cs",
"excludedHeaderFiles": ["ParentHeader.h"]
}
In the example above, MyStruct will be generated in Library.cs.
Alternatively on windows, just try to #include <windows.h> and "excludeHeaderFiles": ["windows.h"]
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Header exclusion? - c++
1 Answer 1 ... Now when Header.h includes <stdbool.h> it will have no effect because it's already been included. This way is technically...
Read more >Best practices for making header file? [closed]
Header files should never contain object definitions, only type definitions and object declarations. I would probably never say never, but ...
Read more >Header Files are Excluded from Analysis when Using any ...
When no sonar-project.properties file is specified, the header and test files appear in the analysis, and coverage is reported.
Read more >Using header files without include? - Programming Questions
hi.. i have an external library that i need to adapt for arduino. one of the issues i have is that it has...
Read more >Ignore header file with module? - Swift Forums
Hi all,. Is there a way to ignore a specific header file when declaring a C dependency? I'm working with a library that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ll add the test case to the integration test when the
multi-passbranch is merged.@waldnercharles I fixed this and added a test for it for regression. See pull request #94.