Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make warning happen in getcwd01.c #1120

Closed
coolgw opened this issue Jan 17, 2024 · 1 comment
Closed

Make warning happen in getcwd01.c #1120

coolgw opened this issue Jan 17, 2024 · 1 comment

Comments

@coolgw
Copy link
Contributor

coolgw commented Jan 17, 2024

Current latest LTP versin show following error, suspect triggered by following commit.

commit 1cfe614
Author: Cyril Hrubis chrubis@suse.cz
Date: Wed Jan 3 12:57:00 2024 +0100

lib: TST_EXP_FAIL: Add array variants

/home/ltp/testcases/kernel/syscalls/getcwd # make clean;make
rm -f -f -r getcwd01 getcwd02 getcwd03 getcwd04 *.o *.pyc .cache.mk .dwo ..dwo
make -C "/home/ltp/lib" -f "/home/ltp/lib/Makefile" all
make[1]: Entering directory '/home/ltp/lib'
GEN ltp-version.h
CC lib/tst_test.o
CC lib/tst_test_macros.o
AR libltp.a
RANLIB libltp.a
make[2]: Nothing to be done for 'all'.
CC lib/newlib_tests/test_macros02
make[1]: Leaving directory '/home/ltp/lib'
In file included from ../../../../include/tst_test.h:21:0,
from getcwd01.c:26:
getcwd01.c: In function ‘verify_getcwd’:
getcwd01.c:48:72: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^
../../../../include/tst_test_macros.h:42:32: note: in definition of macro ‘TST_FMT

#define TST_FMT
(FMT, 1, ...) FMT, ##VA_ARGS
^~~
../../../../include/tst_test_macros.h:46:12: note: in expansion of macro ‘TST_2

TST_FMT_(TST_2_(dummy, ##VA_ARGS, SCALL) FMT, VA_ARGS))
^~~~~~
../../../../include/tst_test_macros.h:209:4: note: in expansion of macro ‘TST_MSG_’
TST_MSG_(TFAIL, " succeeded", SSCALL, ##VA_ARGS);
^~~~~~~~
../../../../include/tst_test_macros.h:251:3: note: in expansion of macro ‘TST_EXP_FAIL_SILENT_’
TST_EXP_FAIL_SILENT_(TST_RET >= 0, SCALL, #SCALL,
^~~~~~~~~~~~~~~~~~~~
../../../../include/tst_test_macros.h:264:3: note: in expansion of macro ‘TST_EXP_FAIL2_ARR_’
TST_EXP_FAIL2_ARR_(SCALL, &tst_exp_err__, 1,
^~~~~~~~~~~~~~~~~~
getcwd01.c:48:2: note: in expansion of macro ‘TST_EXP_FAIL2’
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^~~~~~~~~~~~~
getcwd01.c:48:72: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long int’ [-Wformat=]
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^
../../../../include/tst_test_macros.h:42:32: note: in definition of macro ‘TST_FMT

#define TST_FMT
(FMT, 1, ...) FMT, ##VA_ARGS
^~~
../../../../include/tst_test_macros.h:50:12: note: in expansion of macro ‘TST_2

TST_FMT
(TST_2
(dummy, ##VA_ARGS, SCALL) FMT, VA_ARGS), PAR)
^~~~~~
../../../../include/tst_test_macros.h:214:4: note: in expansion of macro ‘TST_MSGP_’
TST_MSGP_(TFAIL | TTERRNO, " invalid retval %ld",
^~~~~~~~~
../../../../include/tst_test_macros.h:251:3: note: in expansion of macro ‘TST_EXP_FAIL_SILENT_’
TST_EXP_FAIL_SILENT_(TST_RET >= 0, SCALL, #SCALL,
^~~~~~~~~~~~~~~~~~~~
../../../../include/tst_test_macros.h:264:3: note: in expansion of macro ‘TST_EXP_FAIL2_ARR_’
TST_EXP_FAIL2_ARR_(SCALL, &tst_exp_err__, 1,
^~~~~~~~~~~~~~~~~~
getcwd01.c:48:2: note: in expansion of macro ‘TST_EXP_FAIL2’
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^~~~~~~~~~~~~
getcwd01.c:48:72: warning: format ‘%ld’ expects a matching ‘long int’ argument [-Wformat=]
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^
../../../../include/tst_test_macros.h:42:32: note: in definition of macro ‘TST_FMT

#define TST_FMT
(FMT, 1, ...) FMT, ##VA_ARGS
^~~
../../../../include/tst_test_macros.h:50:12: note: in expansion of macro ‘TST_2

TST_FMT
(TST_2
(dummy, ##VA_ARGS, SCALL) FMT, VA_ARGS), PAR)
^~~~~~
../../../../include/tst_test_macros.h:214:4: note: in expansion of macro ‘TST_MSGP_’
TST_MSGP_(TFAIL | TTERRNO, " invalid retval %ld",
^~~~~~~~~
../../../../include/tst_test_macros.h:251:3: note: in expansion of macro ‘TST_EXP_FAIL_SILENT_’
TST_EXP_FAIL_SILENT_(TST_RET >= 0, SCALL, #SCALL,
^~~~~~~~~~~~~~~~~~~~
../../../../include/tst_test_macros.h:264:3: note: in expansion of macro ‘TST_EXP_FAIL2_ARR_’
TST_EXP_FAIL2_ARR_(SCALL, &tst_exp_err__, 1,
^~~~~~~~~~~~~~~~~~
getcwd01.c:48:2: note: in expansion of macro ‘TST_EXP_FAIL2’
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^~~~~~~~~~~~~
getcwd01.c:48:72: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘const char *’ [-Wformat=]
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^
../../../../include/tst_test_macros.h:42:32: note: in definition of macro ‘TST_FMT

#define TST_FMT
(FMT, 1, ...) FMT, ##VA_ARGS
^~~
../../../../include/tst_test_macros.h:50:12: note: in expansion of macro ‘TST_2

TST_FMT
(TST_2
(dummy, ##VA_ARGS, SCALL) FMT, VA_ARGS), PAR)
^~~~~~
../../../../include/tst_test_macros.h:223:4: note: in expansion of macro ‘TST_MSGP_’
TST_MSGP_(TFAIL | TTERRNO, " expected %s",
^~~~~~~~~
../../../../include/tst_test_macros.h:251:3: note: in expansion of macro ‘TST_EXP_FAIL_SILENT_’
TST_EXP_FAIL_SILENT_(TST_RET >= 0, SCALL, #SCALL,
^~~~~~~~~~~~~~~~~~~~
../../../../include/tst_test_macros.h:264:3: note: in expansion of macro ‘TST_EXP_FAIL2_ARR_’
TST_EXP_FAIL2_ARR_(SCALL, &tst_exp_err__, 1,
^~~~~~~~~~~~~~~~~~
getcwd01.c:48:2: note: in expansion of macro ‘TST_EXP_FAIL2’
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^~~~~~~~~~~~~
getcwd01.c:48:72: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^
../../../../include/tst_test_macros.h:42:32: note: in definition of macro ‘TST_FMT

#define TST_FMT
(FMT, 1, ...) FMT, ##VA_ARGS
^~~
../../../../include/tst_test_macros.h:50:12: note: in expansion of macro ‘TST_2

TST_FMT
(TST_2
(dummy, ##VA_ARGS, SCALL) FMT, VA_ARGS), PAR)
^~~~~~
../../../../include/tst_test_macros.h:223:4: note: in expansion of macro ‘TST_MSGP_’
TST_MSGP_(TFAIL | TTERRNO, " expected %s",
^~~~~~~~~
../../../../include/tst_test_macros.h:251:3: note: in expansion of macro ‘TST_EXP_FAIL_SILENT_’
TST_EXP_FAIL_SILENT_(TST_RET >= 0, SCALL, #SCALL,
^~~~~~~~~~~~~~~~~~~~
../../../../include/tst_test_macros.h:264:3: note: in expansion of macro ‘TST_EXP_FAIL2_ARR_’
TST_EXP_FAIL2_ARR_(SCALL, &tst_exp_err__, 1,
^~~~~~~~~~~~~~~~~~
getcwd01.c:48:2: note: in expansion of macro ‘TST_EXP_FAIL2’
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^~~~~~~~~~~~~
getcwd01.c:48:72: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
TST_EXP_FAIL2(tst_syscall(NR_getcwd, tc->buf, tc->size), tc->exp_err);
^
../../../../include/tst_test_macros.h:42:32: note: in definition of macro ‘TST_FMT

#define TST_FMT
(FMT, 1, ...) FMT, ##VA_ARGS
^~~
../../../../include/tst_test_macros.h:46:12: note: in expansion of macro ‘TST_2

TST_FMT
(TST_2
(dummy, ##VA_ARGS, SCALL) FMT, VA_ARGS))
^~~~~~
../../../../include/tst_test_macros.h:254:4: note: in expansion of macro ‘TST_MSG_’
TST_MSG_(TPASS | TTERRNO, " ", #SCALL, ##VA_ARGS);
^~~~~~~~
../../../../include/tst_test_macros.h:264:3: note: in expansion of macro ‘TST_EXP_FAIL2_ARR_’
TST_EXP_FAIL2_ARR_(SCALL, &tst_exp_err__, 1,
^~~~~~~~~~~~~~~~~~
getcwd01.c:48:2: note: in expansion of macro ‘TST_EXP_FAIL2’
TST_EXP_FAIL2(tst_syscall(__NR_getcwd, tc->buf, tc->size), tc->exp_err);
^~~~~~~~~~~~~
CC testcases/kernel/syscalls/getcwd/getcwd01
CC testcases/kernel/syscalls/getcwd/getcwd02
CC testcases/kernel/syscalls/getcwd/getcwd03
CC testcases/kernel/syscalls/getcwd/getcwd04

@metan-ucw
Copy link
Member

Ah, right, the SCALL argument has to be stringified in the first pass otherwise it will expand. Will send a fix right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants