public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/signalfd01.c: Fix compiler warnings
Date: Thu, 16 Aug 2018 13:54:34 +0200	[thread overview]
Message-ID: <20180816115434.GB6547@rei> (raw)
In-Reply-To: <1532087697-28093-1-git-send-email-huangjh.jy@cn.fujitsu.com>

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

  reply	other threads:[~2018-08-16 11:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 11:54 [LTP] [PATCH] syscalls/signalfd01.c: Fix compiler warnings Jinhui huang
2018-08-16 11:54 ` Cyril Hrubis [this message]
2018-08-17  2:39   ` [LTP] [PATCH v2] syscall/signalfd01: " Jinhui huang
2018-08-17 12:55     ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180816115434.GB6547@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox