drgn/libdrgn/m4
Omar Sandoval 1112ff1721 libdrgn: pp: make PP_NARGS() expand to 0
The C standard treats an empty variable argument list as a single, empty
argument, so PP_NARGS() currently expands to 1. But this is surprising,
especially for PP_OVERLOAD(). Use the , ##__VA_ARGS__ GNU C extension to
make PP_NARGS() expand to 0 instead. (We could also use __VA_OPT__(,) to
achieve the same thing. It has the advantage of being standardized for
C23, but the huge disadvantage that it's only available on relatively
recent versions of GCC and Clang.) Also check that the extension is
supported in configure.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2024-04-26 14:53:53 -07:00
..
.gitignore libdrgn: pp: make PP_NARGS() expand to 0 2024-04-26 14:53:53 -07:00
ax_append_compile_flags.m4 libdrgn: add autoconf option to enable compiler warnings 2022-03-01 15:38:05 -08:00
ax_append_flag.m4 libdrgn: add autoconf option to enable UBSan 2022-03-01 15:11:16 -08:00
ax_check_compile_flag.m4 libdrgn: add autoconf option to enable compiler warnings 2022-03-01 15:38:05 -08:00
ax_require_defined.m4 libdrgn: add autoconf option to enable compiler warnings 2022-03-01 15:38:05 -08:00
my_c_auto.m4 libdrgn: define auto to __auto_type via autoconf 2023-08-16 10:32:39 -07:00
my_check_va_args_comma_deletion.m4 libdrgn: pp: make PP_NARGS() expand to 0 2024-04-26 14:53:53 -07:00