[LTP] shmctl03: Fix 32-bit compat mode failure by adjusting comparisons for compat mode truncation

Andrea Cervesato andrea.cervesato@suse.com
Wed Aug 19 09:11:09 CEST 2026


Hi Wei,

> > #define TST_ASSERT_ULONG(path, val, ...) \
> > 	tst_assert_ulong(__FILE__, __LINE__, path, val, (0, ##__VA_ARGS__))
> 
> Could this avoid the comma expression? When a flag is supplied, its left-hand
> operand triggers -Wunused-value, so all three new compat-mode assertions emit
> compiler warnings and builds using -Werror fail. Making the flags argument
> explicit and passing 0 at no-flag call sites, or dispatching separate two- and
> three-argument macro forms, would avoid the warning.

This is correct, we can use TST_2_ which is our default way to avoid these
issues.

#define TST_ASSERT_ULONG(path, val, ...) \
	tst_assert_ulong(__FILE__, __LINE__, path, val, \
		TST_2_(dummy, ##__VA_ARGS__, 0))

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list