When macro _SCMP_VA_NUM_ARGS is invoked with one argument, it expands to _SCMP_VA_NUM_ARGS_IMPL with only 3 arguments specified.
Compilers like gcc and clang support empty variadic macro argument as a language extension, however, in ISO C, at least one argument should be specified for the ... argument of a function-like macro (See ISO/IEC 9899:1999 6.10.3(4)).
This patch should make the code more standard-compliant, and silences certain compiler warnings (e.g. clang -Wgnu-zero-variadic-macro-arguments)
Note: there are other non-standard code (e.g. void pointer arithmetic), but not addressed in this patch. It's okay for projects to use language extensions, but less so in public headers.
coverage: 89.454%. remained the same
when pulling 5b340a519b39bd2c1d1e89ca529b3a5f531f668d on CismonX:main
into 9da5d174e3ef219baab020a79c789f2075ace45c on seccomp:main.
When macro
_SCMP_VA_NUM_ARGS
is invoked with one argument, it expands to_SCMP_VA_NUM_ARGS_IMPL
with only 3 arguments specified.Compilers like gcc and clang support empty variadic macro argument as a language extension, however, in ISO C, at least one argument should be specified for the
...
argument of a function-like macro (See ISO/IEC 9899:1999 6.10.3(4)).This patch should make the code more standard-compliant, and silences certain compiler warnings (e.g. clang
-Wgnu-zero-variadic-macro-arguments
)Note: there are other non-standard code (e.g. void pointer arithmetic), but not addressed in this patch. It's okay for projects to use language extensions, but less so in public headers.