MISRA C:2023 Rule 17.1
Description
Rule Definition
The standard header file <stdarg.h> shall not be used.
Rationale
The rule forbids use of va_list
, va_arg
, va_start
, va_end
,
and va_copy
.
It is possible to use these features in ways where the behavior is not defined in the 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
.
Troubleshooting
If you expect a rule violation but do not see it, refer to Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Function |
Category: Required |
AGC Category: Required |
Version History
Introduced in R2024a