Hey, On Fri, Apr 22, 2011 at 05:36:25PM -0600, Eric Blake wrote: > That evaluates ptr twice. We can do better, by exploiting that the > ternary operator can be used to determine the type of an expression > without evaluating it. Gcc allows 1?(void*)expr:pointer (the resulting > type is void*), but hates 1?(void*)expr:int (promoting to int provokes a > warning): > > cc1: warnings being treated as errors > remote.c: In function 'remoteDispatchListNetworks': > remote.c:3684:70: error: pointer/integer type mismatch in conditional > expression > > So how about:
Sorry for the late answer, but this looks good to me too. Let's hope gcc doesn't get too clever and never stops warning about this. Thanks, Christophe
pgpBuBX1DFq8h.pgp
Description: PGP signature
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list