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]

[PATCH] pe-mips.c: Fix -Werror=misleading-indentation


gcc 6 gives the following error:

/home/emaisin/src/binutils-gdb/bfd/pe-mips.c: In function âcoff_mips_relocâ:
/home/emaisin/src/binutils-gdb/bfd/pe-mips.c:98:5: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
     if (diff != 0)
     ^~
/home/emaisin/src/binutils-gdb/bfd/pe-mips.c:88:3: note: ...this âelseâ clause, but it is not
   else
   ^~~~
cc1: all warnings being treated as errors

I think it's just an indentation error, not an actual bug.

bfd/ChangeLog:

	* pe-mips.c (coff_mips_reloc): Fix indentation.
---
 bfd/pe-mips.c | 60 +++++++++++++++++++++++++++++------------------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c
index 39e4adf..53a5983 100644
--- a/bfd/pe-mips.c
+++ b/bfd/pe-mips.c
@@ -95,44 +95,44 @@ coff_mips_reloc (bfd *abfd,
 #define DOIT(x) \
   x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + (diff >> howto->rightshift)) & 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;
 
-	switch (howto->size)
+      switch (howto->size)
+	{
+	case 0:
 	  {
-	  case 0:
-	    {
-	      char x = bfd_get_8 (abfd, addr);
-
-	      DOIT (x);
-	      bfd_put_8 (abfd, x, addr);
-	    }
-	    break;
+	    char x = bfd_get_8 (abfd, addr);
 
-	  case 1:
-	    {
-	      short x = bfd_get_16 (abfd, addr);
+	    DOIT (x);
+	    bfd_put_8 (abfd, x, addr);
+	  }
+	  break;
 
-	      DOIT (x);
-	      bfd_put_16 (abfd, (bfd_vma) x, addr);
-	    }
-	    break;
+	case 1:
+	  {
+	    short x = bfd_get_16 (abfd, addr);
 
-	  case 2:
-	    {
-	      long x = bfd_get_32 (abfd, addr);
+	    DOIT (x);
+	    bfd_put_16 (abfd, (bfd_vma) x, addr);
+	  }
+	  break;
 
-	      DOIT (x);
-	      bfd_put_32 (abfd, (bfd_vma) x, addr);
-	    }
-	    break;
+	case 2:
+	  {
+	    long x = bfd_get_32 (abfd, addr);
 
-	  default:
-	    abort ();
+	    DOIT (x);
+	    bfd_put_32 (abfd, (bfd_vma) x, addr);
 	  }
-      }
+	  break;
+
+	default:
+	  abort ();
+	}
+    }
 
   /* Now let bfd_perform_relocation finish everything up.  */
   return bfd_reloc_continue;
-- 
2.5.1


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