Skip to content

Commit 0c087a6

Browse files
Merge pull request #1115 from knewbury01/knewbury01/fix-BitFieldsShouldNotBeDeclared
Fix shared query problems predicate format
2 parents e017d52 + 963ac1e commit 0c087a6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

cpp/common/src/codingstandards/cpp/rules/bitfieldsshouldnotbedeclared/BitFieldsShouldNotBeDeclared.qll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ signature module BitFieldsShouldNotBeDeclaredConfigSig {
1717
}
1818

1919
module BitFieldsShouldNotBeDeclared<BitFieldsShouldNotBeDeclaredConfigSig Config> {
20-
query predicate problems(
21-
BitField bf, Class c, string message, Class linkLocation, string linkDescription
22-
) {
20+
query predicate problems(BitField bf, string message, Class c, string className) {
2321
/*
2422
* The condition that is allowed that is IF this is a bit-field, then it should be part of a class
2523
* that is flagged as a hardware or protocol class. To detect this we look for violations of that form.
@@ -28,8 +26,7 @@ module BitFieldsShouldNotBeDeclared<BitFieldsShouldNotBeDeclaredConfigSig Config
2826
not isExcluded(bf, Config::getQuery()) and
2927
not isExcluded(c, Config::getQuery()) and
3028
bf = c.getAField() and
31-
linkLocation = c and
32-
linkDescription = c.getName() and
29+
className = c.getName() and
3330
not c instanceof HardwareOrProtocolInterfaceClass and
3431
message = "Bit-field used within a class $@ that is not a hardware or protocol class."
3532
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.cpp:57:8:57:8 | c | test.cpp:53:7:53:8 | B2 | Bit-field used within a class $@ that is not a hardware or protocol class. | test.cpp:53:7:53:8 | B2 | B2 |
1+
| test.cpp:57:8:57:8 | c | Bit-field used within a class $@ that is not a hardware or protocol class. | test.cpp:53:7:53:8 | B2 | B2 |

0 commit comments

Comments
 (0)