File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import codingstandards.cpp.misra
18
18
class VaListType extends Type {
19
19
VaListType ( ) {
20
20
this .getName ( ) = "va_list" or
21
- this .getName ( ) = "__va_list_tag" or
22
21
this .( SpecifiedType ) .getBaseType ( ) instanceof VaListType or
23
22
this .( TypedefType ) .getBaseType ( ) instanceof VaListType
24
23
}
@@ -29,10 +28,15 @@ where
29
28
not isExcluded ( element , BannedAPIsPackage:: noVariadicFunctionMacrosQuery ( ) ) and
30
29
(
31
30
element .( Variable ) .getType ( ) instanceof VaListType and
32
- message = "Declaration of variable '" + element .( Variable ) .getName ( ) + "' of type 'va_list'."
33
- or
34
- element .( Parameter ) .getType ( ) instanceof VaListType and
35
- message = "Declaration of parameter '" + element .( Parameter ) .getName ( ) + "' of type 'va_list'."
31
+ (
32
+ if element instanceof Parameter
33
+ then
34
+ message =
35
+ "Declaration of parameter '" + element .( Parameter ) .getName ( ) + "' of type 'va_list'."
36
+ else
37
+ message =
38
+ "Declaration of variable '" + element .( Variable ) .getName ( ) + "' of type 'va_list'."
39
+ )
36
40
or
37
41
element instanceof BuiltInVarArgsStart and
38
42
message = "Call to 'va_start'."
50
54
message =
51
55
"Declaration of typedef '" + element .( TypedefType ) .getName ( ) + "' aliasing 'va_list' type."
52
56
)
53
- select element , message
57
+ select element , message
Original file line number Diff line number Diff line change 16
16
| test.cpp:31:3:31:12 | __builtin_va_end | Call to 'va_end'. |
17
17
| test.cpp:32:3:32:12 | __builtin_va_end | Call to 'va_end'. |
18
18
| test.cpp:35:37:35:38 | l1 | Declaration of parameter 'l1' of type 'va_list'. |
19
- | test.cpp:35:37:35:38 | l1 | Declaration of variable 'l1' of type 'va_list'. |
20
19
| test.cpp:36:15:36:32 | __builtin_va_arg | Call to 'va_arg'. |
21
20
| test.cpp:40:11:40:12 | l2 | Declaration of variable 'l2' of type 'va_list'. |
22
21
| test.cpp:41:3:41:18 | __builtin_va_start | Call to 'va_start'. |
You can’t perform that action at this time.
0 commit comments