Skip to content

Commit 2f23d33

Browse files
committed
Preprocessor5: improve alert message Rule MSC38-C
1 parent 0ece5fe commit 2f23d33

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

c/cert/src/rules/MSC38-C/DoNotTreatAPredefinedIdentifierAsObject.ql

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ predicate hasRestrictedMacroName(string s) {
3333
s = "va_start"
3434
}
3535

36-
from Element m, string name, string condition
36+
from Element m, string name
3737
where
3838
not isExcluded(m, Preprocessor5Package::doNotTreatAPredefinedIdentifierAsObjectQuery()) and
3939
(
40-
condition = "Access" and
4140
m.(Access).getTarget().hasName(name)
4241
or
43-
m.(Declaration).hasGlobalName(name) and
44-
condition = "Redefinition"
42+
m.(Declaration).hasGlobalName(name)
4543
) and
4644
hasRestrictedMacroName(name)
47-
select m, condition + " of standard library macro " + name + "."
45+
select m, "Supression of standard library macro " + name + "."
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| test.c:3:12:3:16 | errno | Redefinition of standard library macro errno. |
2-
| test.c:10:21:10:26 | assert | Access of standard library macro assert. |
1+
| test.c:3:12:3:16 | errno | Supression of standard library macro errno. |
2+
| test.c:10:21:10:26 | assert | Supression of standard library macro assert. |

0 commit comments

Comments
 (0)