[PATCH] [Arm/gas] Fix broken build

Luis Machado luis.machado@arm.com
Wed May 25 10:42:25 GMT 2022


On 5/25/22 11:39, Richard Earnshaw wrote:
> 
> 
> On 25/05/2022 11:28, Luis Machado via Binutils wrote:
>> Currently the build fails with:
>>
>> binutils-gdb/gas/config/tc-arm.c: In function ‘s_arm_unwind_save_mixed’:
>> binutils-gdb/gas/config/tc-arm.c:4730:17: error: comparison of integer expressions of different signedness: ‘unsigned int’ and
>>   ‘long int’ [-Werror=sign-compare]
>> ---
>>   gas/config/tc-arm.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
>> index 538d83f5462..9682db974ed 100644
>> --- a/gas/config/tc-arm.c
>> +++ b/gas/config/tc-arm.c
>> @@ -4727,7 +4727,7 @@ s_arm_unwind_save_mixed (long range, long mask_range)
>>     unsigned lim_hi = 0;
>>     /* Iterate over pseudoregister to establish subrange bounds.  */
>> -  for (; lim_hi <= roof; lim_hi++)
>> +  for (; lim_hi <= (unsigned) roof; lim_hi++)
>>       {
>>         if (mask_range & (1 << lim_hi))
>>       {
> 
> Why try to massage roof into a different type - it's defined in this function and there's no obvious reason (to me) why it has to be of type long.
> 
> So IMO, both lim_hi and roof should have the same type, then a cast would not be needed.
I considered that, but assumed it was done that way for a reason. It might be an oversight then, as all the other types are signed.


More information about the Binutils mailing list