* [LTP] [PATCH] tst_test_macros.h: fix "too many arguments"
@ 2024-01-09 9:03 Shiyang Ruan
2024-01-09 11:19 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Shiyang Ruan @ 2024-01-09 9:03 UTC (permalink / raw)
To: ltp
While calling TST_EXP_FD_SILENT() and TST_EXP_PID_SILENT(), their
defined function TST_EXP_POSITIVE_() should pass its SSCALL to
TST_EXP_POSITIVE__(), instead of creating a new one. This fix makes
error message look correct, and also can eliminate build warnings, such
as:
dup3_01.c:43:83: warning: too many arguments for format [-Wformat-extra-args]
43 | TST_EXP_FD_SILENT(dup3(1, 4, tc->coe_flag), "dup3(1, 4, %d)", tc->coe_flag);
| ^
../../../../include/tst_test_macros.h:40:32: note: in definition of macro ‘TST_FMT_’
40 | #define TST_FMT_(FMT, _1, ...) FMT, ##__VA_ARGS__
| ^~~
../../../../include/tst_test_macros.h:44:26: note: in expansion of macro ‘TST_2_’
44 | TST_FMT_(TST_2_(dummy, ##__VA_ARGS__, SCALL) FMT, __VA_ARGS__))
| ^~~~~~
../../../../include/tst_test_macros.h:61:25: note: in expansion of macro ‘TST_MSG_’
61 | TST_MSG_(TFAIL | TTERRNO, " failed", \
| ^~~~~~~~
../../../../include/tst_test_macros.h:78:17: note: in expansion of macro ‘TST_EXP_POSITIVE__’
78 | TST_EXP_POSITIVE__(SCALL, #SCALL, ##__VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~
../../../../include/tst_test_macros.h:94:41: note: in expansion of macro ‘TST_EXP_POSITIVE_’
94 | #define TST_EXP_FD_SILENT(SCALL, ...) TST_EXP_POSITIVE_(SCALL, #SCALL, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~
dup3_01.c:43:9: note: in expansion of macro ‘TST_EXP_FD_SILENT’
43 | TST_EXP_FD_SILENT(dup3(1, 4, tc->coe_flag), "dup3(1, 4, %d)", tc->coe_flag);
| ^~~~~~~~~~~~~~~~~
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
---
include/tst_test_macros.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
index bd0c491c1..3f4f9f11d 100644
--- a/include/tst_test_macros.h
+++ b/include/tst_test_macros.h
@@ -73,9 +73,9 @@ extern void *TST_RET_PTR;
\
} while (0)
-#define TST_EXP_POSITIVE_(SCALL, ...) \
+#define TST_EXP_POSITIVE_(SCALL, SSCALL, ...) \
({ \
- TST_EXP_POSITIVE__(SCALL, #SCALL, ##__VA_ARGS__); \
+ TST_EXP_POSITIVE__(SCALL, SSCALL, ##__VA_ARGS__); \
TST_RET; \
})
--
2.34.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] tst_test_macros.h: fix "too many arguments"
2024-01-09 9:03 [LTP] [PATCH] tst_test_macros.h: fix "too many arguments" Shiyang Ruan
@ 2024-01-09 11:19 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2024-01-09 11:19 UTC (permalink / raw)
To: Shiyang Ruan; +Cc: ltp
Hi!
Good catch, I've noticed the problem last week and planned to have a
look this week but you were faster. Applied, thanks.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-09 11:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-09 9:03 [LTP] [PATCH] tst_test_macros.h: fix "too many arguments" Shiyang Ruan
2024-01-09 11:19 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox