public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Commit: Fix whitespace snafu in tc-riscv.c
@ 2023-12-12 10:02 Nick Clifton
  2023-12-12 10:34 ` Nelson Chu
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Clifton @ 2023-12-12 10:02 UTC (permalink / raw)
  To: binutils

Hi Guys

  I am applying the patch below in order to fix this compile time
  warning/error message:

    gas/config/tc-riscv.c: In function 'md_apply_fix':
    gas/config/tc-riscv.c:4364:11: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    4364 |           if (!riscv_record_pcrel_fixup (riscv_pcrel_hi_fixup_hash,
         |           ^~
    gas/config/tc-riscv.c:4370:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    4370 |             bfd_putl32 (bfd_getl32 (buf)
         |             ^~~~~~~~~~

Cheers
  Nick

diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index a46a6a4ec48..b902c6ba2c1 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -4367,11 +4367,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 					 target))
 	    as_warn (_("too many pcrel_hi"));
 
-	    bfd_putl32 (bfd_getl32 (buf)
-			| ENCODE_UTYPE_IMM (RISCV_CONST_HIGH_PART (value)),
-			buf);
-	    if (!riscv_opts.relax)
-	      fixP->fx_done = 1;
+	  bfd_putl32 (bfd_getl32 (buf)
+		      | ENCODE_UTYPE_IMM (RISCV_CONST_HIGH_PART (value)),
+		      buf);
+	  if (!riscv_opts.relax)
+	    fixP->fx_done = 1;
 	}
       relaxable = true;
       break;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Commit: Fix whitespace snafu in tc-riscv.c
  2023-12-12 10:02 Commit: Fix whitespace snafu in tc-riscv.c Nick Clifton
@ 2023-12-12 10:34 ` Nelson Chu
  0 siblings, 0 replies; 2+ messages in thread
From: Nelson Chu @ 2023-12-12 10:34 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]

Thanks, I didn't notice the indentation of the code here :-(

Nelson

On Tue, Dec 12, 2023 at 6:03 PM Nick Clifton <nickc@redhat.com> wrote:

> Hi Guys
>
>   I am applying the patch below in order to fix this compile time
>   warning/error message:
>
>     gas/config/tc-riscv.c: In function 'md_apply_fix':
>     gas/config/tc-riscv.c:4364:11: error: this 'if' clause does not
> guard... [-Werror=misleading-indentation]
>     4364 |           if (!riscv_record_pcrel_fixup
> (riscv_pcrel_hi_fixup_hash,
>          |           ^~
>     gas/config/tc-riscv.c:4370:13: note: ...this statement, but the latter
> is misleadingly indented as if it were guarded by the 'if'
>     4370 |             bfd_putl32 (bfd_getl32 (buf)
>          |             ^~~~~~~~~~
>
> Cheers
>   Nick
>
> diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
> index a46a6a4ec48..b902c6ba2c1 100644
> --- a/gas/config/tc-riscv.c
> +++ b/gas/config/tc-riscv.c
> @@ -4367,11 +4367,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg
> ATTRIBUTE_UNUSED)
>                                          target))
>             as_warn (_("too many pcrel_hi"));
>
> -           bfd_putl32 (bfd_getl32 (buf)
> -                       | ENCODE_UTYPE_IMM (RISCV_CONST_HIGH_PART (value)),
> -                       buf);
> -           if (!riscv_opts.relax)
> -             fixP->fx_done = 1;
> +         bfd_putl32 (bfd_getl32 (buf)
> +                     | ENCODE_UTYPE_IMM (RISCV_CONST_HIGH_PART (value)),
> +                     buf);
> +         if (!riscv_opts.relax)
> +           fixP->fx_done = 1;
>         }
>        relaxable = true;
>        break;
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-12 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-12 10:02 Commit: Fix whitespace snafu in tc-riscv.c Nick Clifton
2023-12-12 10:34 ` Nelson Chu

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).