Commit: Fix whitespace snafu in tc-riscv.c

Nelson Chu nelson@rivosinc.com
Tue Dec 12 10:34:25 GMT 2023


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;
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20231212/6b27e26e/attachment.htm>


More information about the Binutils mailing list