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

Andrea Cervesato via ltp <[email protected]>
Newsgroups it.linux.lists.ltp
Message-ID <[email protected]>
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
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.