qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [5275] Suppress gcc 4.x -Wpointer-sign (included in -Wa


From: Ian Jackson
Subject: Re: [Qemu-devel] [5275] Suppress gcc 4.x -Wpointer-sign (included in -Wall) warnings
Date: Tue, 28 Oct 2008 16:54:56 +0000

Blue Swirl writes ("[Qemu-devel] [5275] Suppress gcc 4.x -Wpointer-sign 
(included in -Wall) warnings"):
> -        ret = sprintf(phys_ram_base + (16 << 20) - 256,
> +        ret = sprintf((char *)(phys_ram_base + (16 << 20) - 256),

I realise I'm a bit late with this comment (my apologies), but:

I think this shows that it would be better to suppress the warning
with the appropriate compiler option, than to try to update the code.

IMO the warning is a mistake since representational compatibility
between corresponding signed and unsigned types is certain for any
platform qemu could plausibily support.

And these kind of casts are dangerous because they can suppress
serious warnings about pointer/integer mismatch.

Ian.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]