CWE-686

Function Call With Incorrect Argument Type. [Improper-Adherence-To-Coding-Standards]

Required inputs: IR

The product calls a function, procedure, or routine, but the caller specifies an argument that is the wrong data type, which may lead to resultant weaknesses. This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.Excerpts from CWE [https://cwe.mitre.org], Copyright (C) 2006-2026, the MITRE Corporation. See section 9.4. "3rd-Party Licenses" in the documentation for full details.

Possible Messages

Key

Text

Severity

Disabled

ellipsis_called_without_prototype

Cannot call function with ellipsis without a prototype declaration

None

False

real_only_called_with_complex_arg

Calling a real-only function with a complex argument results in undefined behavior.

None

False

wrong_argument_type

Parameter {} of {} expects type ‘{}’, but ‘{}’ was given.

None

False

wrong_argument_type_multiple_allowed

Variable argument was passed type ‘{}’, which is not among the expected types.

None

False

wrong_argument_type_va

Variable arguments expect type ‘{}’, but ‘{}’ was given.

None

False

Options

real_only_macros

real_only_macros

Type: set[bauhaus.analysis.config.MacroName]

Default: {'atan2', 'cbrt', 'ceil', 'copysign', 'erf', 'erfc', 'exp2', 'expm1', 'fdim', 'floor', 'fma', 'fmax', 'fmin', 'fmod', 'frexp', 'hypot', 'ilogb', 'ldexp', 'lgamma', 'llrint', 'llround', 'log10', 'log1p', 'log2', 'logb', 'lrint', 'lround', 'nearbyint', 'nextafter', 'nexttoward', 'remainder', 'remquo', 'rint', 'round', 'scalbln', 'scalbn', 'tgamma', 'trunc'}

Names of real-only macros.
 

use_pointer_analysis

use_pointer_analysis : bool = True

Whether to use pointer analysis to verify indirect calls.

Note: pointer analysis can only be used if StaticSemanticAnalysis is enabled.