avifil32: Removed sign comparison warning (sizeof expresions)

Michael Stefaniuc mstefani at redhat.com
Mon Aug 23 10:30:43 CDT 2010

Alexandre Julliard wrote:
> Marko Nikolic <grkoma at gmail.com> writes:
>> What remains is how to correctly remove warning. In this case (and there are 
>> many similar in the code), signed function parameter is comparing with 
>> values that are natively unsigned. Changing type of the parameter is not 
>> possible, the same if with sizeof operator. One possiblity is to add some 
>> temporary variable, but in my opinioin it will just unncesary bloat the code 
>> and is worse than casting return value of sizeof.
> In general a negative size would be an error too, so casting the sizeof
> wouldn't do the right thing.
Hmm ... gcc would still issue the warning even if we know that
formatsize cannot be negative aka
    formatsize >= 0 && formatsize <= sizeof(PCMWAVEFORMAT)
would still produce a warning.


More information about the wine-devel mailing list