Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2f23d33

Browse filesBrowse files
committed
Preprocessor5: improve alert message Rule MSC38-C
1 parent 0ece5fe commit 2f23d33
Copy full SHA for 2f23d33

File tree

2 files changed

+5
-7
lines changed
Filter options

2 files changed

+5
-7
lines changed

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

Copy file name to clipboardExpand all lines: c/cert/src/rules/MSC38-C/DoNotTreatAPredefinedIdentifierAsObject.ql
+3-5Lines 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 + "."
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.