Commit: Fix whitespace snafu in tc-riscv.c

Message ID 87edfroi0w.fsf@redhat.com
State New
Headers
Series Commit: Fix whitespace snafu in tc-riscv.c |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 warning Patch is already merged

Commit Message

Nick Clifton Dec. 12, 2023, 10:02 a.m. UTC
  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
  

Comments

Nelson Chu Dec. 12, 2023, 10:34 a.m. UTC | #1
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;
>
>
  

Patch

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;