[Spice-devel] [PATCH 2/2] python: Fix -Wsign-compare

Marc-André Lureau mlureau at redhat.com
Wed Sep 3 05:58:10 PDT 2014


Hi

----- Original Message -----
> The most part of the values are already unsigned values. The exceptions,
> that are causing the warnings, are:
> 
> generated_server_marshallers.c:1387:27: warning: comparison between
> signed and unsigned integer expressions [-Wsign-compare]
>              for (j = 0; j < (((src2->width + 7) / 8 ) * src2->height);
> j++) {
>                            ^
> generated_server_marshallers.c:1411:27: warning: comparison between
> signed and unsigned integer expressions [-Wsign-compare]
>              for (j = 0; j < (((4 * src2->width + 7) / 8 ) *
> src2->height); j++) {
>                            ^
> generated_server_marshallers.c:1435:27: warning: comparison between
> signed and unsigned integer expressions [-Wsign-compare]
>              for (j = 0; j < (src2->width * src2->height); j++) {
> 
> And those cannot be negative.

Ah, could we instead cast the result of get_array_size() for the image type arrays ?


More information about the Spice-devel mailing list