This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Commit: Fix formatting in coff-i386.c


On Fri, 2015-12-18 at 08:36 +0000, Nick Clifton wrote:
> Hi Guys,
> 
>   I was trying to bootstrap the mainline gcc sources yesterday using the
>   latest binutils sources and I cam across this error:
> 
> bfd/coff-i386.c: In function 'coff_i386_reloc':
> bfd/coff-i386.c:142:5: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
>      if (diff != 0)
>      ^~
> bfd/coff-i386.c:133:3: note: ...this 'if' clause, but it is not
>    if (reloc_entry->howto->type == R_IMAGEBASE
>    ^~
> 
>   It turns out to be a simple case of mis-indentation of an if
>   statement, so I am checking in the patch below to fix the problem.
> 
> Cheers
>   Nick
> 
> bfd/ChangeLog
> 2015-12-18  Nick Clifton  <nickc@redhat.com>
> 
> 	* coff-i386.c (coff_i386_reloc): Fix formatting.
> 
> diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c
> index a9725c4..1b1a815 100644
> --- a/bfd/coff-i386.c
> +++ b/bfd/coff-i386.c
> @@ -139,41 +139,41 @@ coff_i386_reloc (bfd *abfd,
>  #define DOIT(x) \
>    x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
>  
> -    if (diff != 0)
> -      {
> -	reloc_howto_type *howto = reloc_entry->howto;
> -	unsigned char *addr = (unsigned char *) data + reloc_entry->address;
> +  if (diff != 0)
> +    {
> +      reloc_howto_type *howto = reloc_entry->howto;
> +      unsigned char *addr = (unsigned char *) data + reloc_entry->address;

Sorry if this is somewhat off-topic, but did you feel the warning was
justified?

It looks like this would have been silenced by a tweak I've proposed to
gcc's -Wmisleading-indentation heuristic (or at least to the version in
-Wall), here:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01011.html



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]