public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Luis Machado <luis.machado@arm.com>, binutils@sourceware.org
Subject: Re: [PATCH] [Arm/gas] Fix broken build
Date: Wed, 25 May 2022 11:39:09 +0100	[thread overview]
Message-ID: <c47d07c2-e456-5bbb-5e0c-3772bf427ca3@foss.arm.com> (raw)
In-Reply-To: <20220525102852.106812-1-luis.machado@arm.com>



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.

  reply	other threads:[~2022-05-25 10:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 10:28 Luis Machado
2022-05-25 10:39 ` Richard Earnshaw [this message]
2022-05-25 10:42   ` Luis Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c47d07c2-e456-5bbb-5e0c-3772bf427ca3@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=binutils@sourceware.org \
    --cc=luis.machado@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).