2023-05-03 11:06:20 +02:00
== Why is this an issue?
2023-07-11 13:33:40 +02:00
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.
2021-04-28 18:08:03 +02:00
2023-05-03 11:06:20 +02:00
== Resources
2021-04-28 16:49:39 +02:00
2023-07-11 13:33:40 +02:00
* 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]
2021-04-28 16:49:39 +02:00
* MISRA C:2004, 19.8 - A function-like macro shall not be invoked without all of its arguments.
2023-07-11 13:33:40 +02:00
* https://cwe.mitre.org/data/definitions/628[CWE] - CWE-628: Function Call with Incorrectly Specified Arguments
2021-04-28 18:08:03 +02:00
2021-09-20 15:38:42 +02:00
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
2023-05-25 14:18:12 +02:00
=== Message
The invocation of macro "xxx" requires "yyy" arguments, but only "xxx" were provided.
2021-09-20 15:38:42 +02:00
endif::env-github,rspecator-view[]