Re: [PATCH] gcc6 narrowing error

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

 



On 06/21/2016 01:21 PM, Clemens Ladisch wrote:
> Michel Normand wrote:
>> [   51s] Cus428Midi.cc:83:1: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
>>
>> -	-1, -1, -1, -1, -1, -1
>> +	(char)-1, (char)-1, (char)-1, (char)-1, (char)-1, (char)-1
> 
> The warning is wrong, because the value is a constant that fits into the
> narrower type.

Not if char is unsigned char, which it is on some platforms. Best is
probably to mark the array as explicitly signed or unsigned otherwise these
warnings will appear on one or the other platform.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux