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
Compiling fail(), fail_if(), or fail_unless() macros emits a warning like this:
/builddir/build/BUILD/libdnf-0.73.4-build/libdnf-0.73.4/tests/hawkey/test_goal.cpp:439:18: warning: too many arguments for format [-Wformat-extra-args]
439 | fail("assert_list_names(): list too short");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The cause is that the macros pass an extra NULL argument:
_ck_assert_failed("FILE", LINE, "Failed", "assert_list_names(): list too short", NULL);
where the NULL argument is superfluous.
Observed with check-0.15.2 and gcc-15.0.1.
I guess the NULL argument should be removed as in ck_assert_msg() definition. Though, maybe you keep the deprecated macros broken on purposes, to preserve compatibility.
The text was updated successfully, but these errors were encountered:
ppisar
changed the title
fail(), fail_if(), or fail_unless() warns about "too many arguments for format" becaue of an extra NULL argument
fail(), fail_if(), or fail_unless() warns about "too many arguments for format" because of an extra NULL argument
Jan 16, 2025
Compiling fail(), fail_if(), or fail_unless() macros emits a warning like this:
The cause is that the macros pass an extra NULL argument:
to _ck_assert_failed() function declared with check for a printf formatting string:
Then the exampled macro expands to:
where the NULL argument is superfluous.
Observed with check-0.15.2 and gcc-15.0.1.
I guess the NULL argument should be removed as in ck_assert_msg() definition. Though, maybe you keep the deprecated macros broken on purposes, to preserve compatibility.
The text was updated successfully, but these errors were encountered: