MISRA C++:2023 Rule 21.10.1
Description
Rule Definition
The features of <cstdarg>
shall not be
used.
Rationale
The rule forbids use of va_list
, va_arg
, va_start
, va_end
, and va_copy
.
You can use these features in ways where the behavior is not defined in the C++ standard. For instance:
You invoke
va_start
in a function but do not invoke the correspondingva_end
before the function block ends.You invoke
va_arg
in different functions on the same variable of typeva_list
.va_arg
has the syntaxtype va_arg (va_list ap, type)
.You invoke
va_arg
with atype
that is incompatible with the actual type of the argument retrieved fromap
.
Polyspace Implementation
The checker reports a violation if you use any of these functions from
<sstdarg>
: va_list
, va_arg
,
va_start
, va_end
, and
va_copy
.
Troubleshooting
If you expect a rule violation but Polyspace® does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Language Support Library |
Category: Required |
Version History
Introduced in R2024b