[binutils-gdb] csky/opcodes: enclose if body in curly braces

Andrew Burgess aburgess@sourceware.org
Thu Sep 24 14:15:39 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=011a045a6b3ea45115221a4fbdc2da87c82a6055

commit 011a045a6b3ea45115221a4fbdc2da87c82a6055
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Thu Sep 24 15:03:43 2020 +0100

    csky/opcodes: enclose if body in curly braces
    
    This commit:
    
      commit afdcafe89118cee761f9bf67ea1b1efc29311300
      Date:   Thu Sep 17 14:30:28 2020 +0800
    
          CSKY: Add objdump option -M abi-names.
    
    cases the build of GDB (configured with --enabled-targets=all) to fail
    with this error:
    
      libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../src/opcodes -I. -I../../src/opcodes -I../bfd -I../../src/opcodes/../include -I../../src/opcodes/../bfd -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Werror -O0 -g3 -D_GLIBCXX_DEBUG=1 -MT csky-dis.lo -MD -MP -MF .deps/csky-dis.Tpo -c ../../src/opcodes/csky-dis.c -o csky-dis.o
      ../../src/opcodes/csky-dis.c: In function 'csky_output_operand':
      ../../src/opcodes/csky-dis.c:849:7: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
        849 |       if (IS_CSKY_V1 (mach_flag))
            |       ^~
      ../../src/opcodes/csky-dis.c:851:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
        851 |  strcat (str, buf);
            |  ^~~~~~
    
    this commit adds { ... } around the if body to resolve this issue.
    
    opcodes/ChangeLog:
    
            * csky-dis.c (csky_output_operand): Enclose body of if in curly
            braces.

Diff:
---
 opcodes/ChangeLog  | 5 +++++
 opcodes/csky-dis.c | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index c26eaff2135..02d44490936 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2020-09-24  Andrew Burgess <andrew.burgess@embecosm.com>
+
+	* csky-dis.c (csky_output_operand): Enclose body of if in curly
+	braces.
+
 2020-09-24  Lili Cui  <lili.cui@intel.com>
 
 	* i386-dis.c (enum): Add PREFIX_0F01_REG_1_RM_5,
diff --git a/opcodes/csky-dis.c b/opcodes/csky-dis.c
index 67fb4ee87ed..ce20f58c473 100644
--- a/opcodes/csky-dis.c
+++ b/opcodes/csky-dis.c
@@ -847,8 +847,10 @@ csky_output_operand (char *str, struct operand const *oprnd,
       }
     case OPRND_TYPE_REGr4_r7:
       if (IS_CSKY_V1 (mach_flag))
-	sprintf (buf, "%s-%s", get_gr_name (4), get_gr_name (7));
-	strcat (str, buf);
+	{
+	  sprintf (buf, "%s-%s", get_gr_name (4), get_gr_name (7));
+	  strcat (str, buf);
+	}
       break;
     case OPRND_TYPE_CONST1:
       strcat (str, "1");


More information about the Binutils-cvs mailing list