Skip to content

Commit 482b5f3

Browse files
authored
Merge pull request github#15265 from github/redsun82/def-to-non-header-include-exceptions
C++: add `.def` to exceptions to AV rule 32
2 parents 51fe477 + 27160b8 commit 482b5f3

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The `cpp/include-non-header` style query will now ignore the `.def` extension for textual header inclusions.

cpp/ql/src/jsf/4.06 Pre-Processing Directives/AV Rule 32.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ from Include i, File f, string extension
1818
where
1919
f = i.getIncludedFile() and
2020
extension = f.getExtension().toLowerCase() and
21+
extension != "def" and
2122
extension != "inc" and
2223
extension != "inl" and
2324
extension != "tcc" and
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
#include "test.H"
2-
#include "test.xpm"
3-
#include "test2.c"
1+
#include "test.H" // GOOD
2+
#include "test.xpm" // GOOD
3+
#include "test2.c" // BAD
4+
#include "test.def" // GOOD

cpp/ql/test/query-tests/jsf/4.06 Pre-Processing Directives/AV Rule 32/test.def

Whitespace-only changes.

0 commit comments

Comments
 (0)