From: Karel Zak <kzak@redhat.com>
To: Sami Kerola <kerolasa@iki.fi>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 1/2] libblkid: fix compiler warning [smatch]
Date: Tue, 8 Oct 2013 15:52:43 +0200 [thread overview]
Message-ID: <20131008135243.GB13559@x2.net.home> (raw)
In-Reply-To: <1381183463-1297-1-git-send-email-kerolasa@iki.fi>
On Mon, Oct 07, 2013 at 11:04:22PM +0100, Sami Kerola wrote:
> warning: overflow in implicit constant conversion
>
> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
> ---
> libblkid/src/superblocks/bcache.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libblkid/src/superblocks/bcache.c b/libblkid/src/superblocks/bcache.c
> index 303f7ee..f5a8ce6 100644
> --- a/libblkid/src/superblocks/bcache.c
> +++ b/libblkid/src/superblocks/bcache.c
> @@ -20,7 +20,7 @@
> #define node(i, j) ((i)->d + (j))
> #define end(i) node(i, (i)->keys)
>
> -static const char bcache_magic[] = {
> +static const unsigned char bcache_magic[] = {
> 0xc6, 0x85, 0x73, 0xf6, 0x4e, 0x1a, 0x45, 0xca,
> 0x82, 0x65, 0xf5, 0x7f, 0x48, 0xba, 0x6d, 0x81
> };
The code is correct, the magic string is "const char *", not
unsigned... gcc does not like your patch:
libblkid/src/superblocks/bcache.c:129:3: warning: pointer targets in initialization differ in signedness [-Wpointer-sign]
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2013-10-08 13:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 22:04 [PATCH 1/2] libblkid: fix compiler warning [smatch] Sami Kerola
2013-10-07 22:04 ` [PATCH 2/2] various: fix mixing declarations and code compiler warnings [smatch] Sami Kerola
2013-10-08 13:55 ` Karel Zak
2013-10-08 13:52 ` Karel Zak [this message]
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=20131008135243.GB13559@x2.net.home \
--to=kzak@redhat.com \
--cc=kerolasa@iki.fi \
--cc=util-linux@vger.kernel.org \
/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