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
1818class VaListType extends Type {
1919 VaListType ( ) {
2020 this .getName ( ) = "va_list" or
21- this .getName ( ) = "__va_list_tag" or
2221 this .( SpecifiedType ) .getBaseType ( ) instanceof VaListType or
2322 this .( TypedefType ) .getBaseType ( ) instanceof VaListType
2423 }
@@ -29,10 +28,15 @@ where
2928 not isExcluded ( element , BannedAPIsPackage:: noVariadicFunctionMacrosQuery ( ) ) and
3029 (
3130 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+ )
3640 or
3741 element instanceof BuiltInVarArgsStart and
3842 message = "Call to 'va_start'."
5054 message =
5155 "Declaration of typedef '" + element .( TypedefType ) .getName ( ) + "' aliasing 'va_list' type."
5256 )
53- select element , message
57+ select element , message
Original file line number Diff line number Diff line change 1616| test.cpp:31:3:31:12 | __builtin_va_end | Call to 'va_end'. |
1717| test.cpp:32:3:32:12 | __builtin_va_end | Call to 'va_end'. |
1818| 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'. |
2019| test.cpp:36:15:36:32 | __builtin_va_arg | Call to 'va_arg'. |
2120| test.cpp:40:11:40:12 | l2 | Declaration of variable 'l2' of type 'va_list'. |
2221| 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