Re: [PATCH 1/2] libblkid: fix compiler warning [smatch]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
> ---
>  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@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux