24 lines
970 B
Plaintext
24 lines
970 B
Plaintext
== Why is this an issue?
|
|
|
|
Before compilation, the preprocessor replaces macros with the code they expand to. The resulting code may be invalid when a function-like macro is invoked without all its arguments, which can cause the program to fail to compile or to behave unexpectedly at runtime.
|
|
|
|
== Resources
|
|
|
|
* CPP reference - https://en.cppreference.com/w/cpp/preprocessor/replace[Replacing text macros]
|
|
* CPP reference - https://en.cppreference.com/w/cpp/language/translation_phases#Phase_3[Phases of translation: Phase 3]
|
|
* MISRA C:2004, 19.8 - A function-like macro shall not be invoked without all of its arguments.
|
|
* https://cwe.mitre.org/data/definitions/628[CWE] - CWE-628: Function Call with Incorrectly Specified Arguments
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
The invocation of macro "xxx" requires "yyy" arguments, but only "xxx" were provided.
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|