* [PATCH] [Arm/gas] Fix broken build
@ 2022-05-25 10:28 Luis Machado
2022-05-25 10:39 ` Richard Earnshaw
0 siblings, 1 reply; 3+ messages in thread
From: Luis Machado @ 2022-05-25 10:28 UTC (permalink / raw)
To: binutils
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))
{
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [Arm/gas] Fix broken build
2022-05-25 10:28 [PATCH] [Arm/gas] Fix broken build Luis Machado
@ 2022-05-25 10:39 ` Richard Earnshaw
2022-05-25 10:42 ` Luis Machado
0 siblings, 1 reply; 3+ messages in thread
From: Richard Earnshaw @ 2022-05-25 10:39 UTC (permalink / raw)
To: Luis Machado, binutils
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.
R.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [Arm/gas] Fix broken build
2022-05-25 10:39 ` Richard Earnshaw
@ 2022-05-25 10:42 ` Luis Machado
0 siblings, 0 replies; 3+ messages in thread
From: Luis Machado @ 2022-05-25 10:42 UTC (permalink / raw)
To: Richard Earnshaw, binutils
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-25 10:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 10:28 [PATCH] [Arm/gas] Fix broken build Luis Machado
2022-05-25 10:39 ` Richard Earnshaw
2022-05-25 10:42 ` Luis Machado
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).