You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run clang linenoise.c -c -pedantic-errors I get the following error messages:
linenoise.c:622:31: error: must specify at least one argument for '...' parameter of variadic macro [-Werror,-Wgnu-zero-variadic-macro-arguments]
lndebug("clear+up");
^
linenoise.c:184:9: note: macro 'lndebug' defined here
#define lndebug(fmt, ...)
^
linenoise.c:630:24: error: must specify at least one argument for '...' parameter of variadic macro [-Werror,-Wgnu-zero-variadic-macro-arguments]
lndebug("clear");
^
linenoise.c:184:9: note: macro 'lndebug' defined here
#define lndebug(fmt, ...)
^
linenoise.c:654:32: error: must specify at least one argument for '...' parameter of variadic macro [-Werror,-Wgnu-zero-variadic-macro-arguments]
lndebug("<newline>");
^
linenoise.c:184:9: note: macro 'lndebug' defined here
#define lndebug(fmt, ...)
^
linenoise.c:683:17: error: must specify at least one argument for '...' parameter of variadic macro [-Werror,-Wgnu-zero-variadic-macro-arguments]
lndebug("\n");
^
linenoise.c:184:9: note: macro 'lndebug' defined here
#define lndebug(fmt, ...)
^
4 errors generated.
I was able to fix this by changing the default signature of the lndebug macro macro:
This way it has the same signature as the implementation used when debugging is enabled. Because of this I figured it should behave the same way it did previously. The downside of this change is that now if one doesn't compile with both clang and -pedantic-errors, lndebug could be called without any arguments at all. Since this is already the case with the actual implementation though it seems to me like this doesn't really matter.
Is there any reason why lndebug requires the fmt parameter and could this potentially be changed to allow clang -pedantic-errors?
The text was updated successfully, but these errors were encountered:
thass0
changed the title
Compilation fails with clang and -pedantic-errors
Compilation fails with clang version 16.0.4 and -pedantic-errorsJun 19, 2023
When I run
clang linenoise.c -c -pedantic-errors
I get the following error messages:I was able to fix this by changing the default signature of the
lndebug
macro macro:This way it has the same signature as the implementation used when debugging is enabled. Because of this I figured it should behave the same way it did previously. The downside of this change is that now if one doesn't compile with both clang and
-pedantic-errors
,lndebug
could be called without any arguments at all. Since this is already the case with the actual implementation though it seems to me like this doesn't really matter.Is there any reason why
lndebug
requires thefmt
parameter and could this potentially be changed to allowclang -pedantic-errors
?The text was updated successfully, but these errors were encountered: