[LTP] [PATCH] syscalls/signalfd01.c: Fix compiler warnings
Cyril Hrubis
chrubis@suse.cz
Thu Aug 16 13:54:34 CEST 2018
Hi!
> tst_resm(TFAIL,
> "getting incomplete signalfd_siginfo data: "
> - "actual-size=%" PRId32 ", expected-size=%" PRId32,
> + "actual-size=%zd" PRId32 ", expected-size=%ld" PRId32,
> s, sizeof(struct signalfd_siginfo));
This is obviously wrong, you have to, at least, remove the PRId32
formatting strings here. Also sizeof() returns size_t hence it should
be formatted with %zu.
> sfd_for_next = -1;
> close(sfd);
> @@ -170,7 +170,7 @@ int do_test1(int ntst, int sig)
> goto out;
> }
>
> - if (fdsi.SIGNALFD_PREFIX(signo) == sig) {
> + if ((int)fdsi.SIGNALFD_PREFIX(signo) == sig) {
Maybe it would be clearner to defined the sig to be uint32_t rathe than
sprinkle the code with int casts
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list