AutosarC++18_03-A8.4.1

Functions shall not be defined using the ellipsis notation

Required inputs: IR

This rule prevents the definition of C-style variadic functions. The use of strongly-typed means of parameter passing is preferable. In C++11, consider the use of parameter packs.

Calls to existing functions with variable arguments (such as printf) are allowed by this rule.

Rationale
Variable arguments are difficult to use correctly: if the number and types of the arguments passed by the caller does not match those expected by the callee, undefined behavior will occur.

Possible Messages

Key

Text

Severity

Disabled

ellipsis_parameter

Function definitions shall not use ellipsis

None

False

Options

ignore_declarations

ignore_declarations : bool = True

Allow declarations of functions with variable number of arguments (e.g. for existing library functions); only report definitions.
 

ignore_inherited

ignore_inherited : bool = False

Do not report functions inheriting a variable number of arguments.