More -Wstack-usage warnings: opcodes/aarch64-*
authorJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 24 Mar 2016 21:42:09 +0000 (22:42 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 24 Mar 2016 21:42:09 +0000 (22:42 +0100)
opcodes Fix -Wstack-usage warnings.
* aarch64-dis.c (print_operands): Substitute size.
* aarch64-opc.c (print_register_offset_address): Substitute tblen.

opcodes/ChangeLog
opcodes/aarch64-dis.c
opcodes/aarch64-opc.c

index 3678971802f4814a9dc2ffc039cdbf2fed1dd4a8..3fc87d69ecacb626239a74f1791dd9cbdd7d5eff 100644 (file)
@@ -1,3 +1,9 @@
+2016-03-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix -Wstack-usage warnings.
+       * aarch64-dis.c (print_operands): Substitute size.
+       * aarch64-opc.c (print_register_offset_address): Substitute tblen.
+
 2016-03-22  Jose E. Marchesi  <jose.marchesi@oracle.com>
 
        * sparc-opc.c (sparc_opcodes): Reorder entries for `rd' in order
index 025d5d1904038790bf2cd2a800f299814011fcb8..05e47681999093d27a86b67ec1739c1a723c77b2 100644 (file)
@@ -2154,8 +2154,7 @@ print_operands (bfd_vma pc, const aarch64_opcode *opcode,
   int i, pcrel_p, num_printed;
   for (i = 0, num_printed = 0; i < AARCH64_MAX_OPND_NUM; ++i)
     {
-      const size_t size = 128;
-      char str[size];
+      char str[128];
       /* We regard the opcode operand info more, however we also look into
         the inst->operands to support the disassembling of the optional
         operand.
@@ -2166,7 +2165,7 @@ print_operands (bfd_vma pc, const aarch64_opcode *opcode,
        break;
 
       /* Generate the operand string in STR.  */
-      aarch64_print_operand (str, size, pc, opcode, opnds, i, &pcrel_p,
+      aarch64_print_operand (str, sizeof (str), pc, opcode, opnds, i, &pcrel_p,
                             &info->target);
 
       /* Print the delimiter (taking account of omitted operand(s)).  */
index ae06ee35fec5c5d6ba67b7111478be120e8b1982..76992df7e740974fc9c8c8cf84832a7938767e5b 100644 (file)
@@ -2301,8 +2301,7 @@ static void
 print_register_offset_address (char *buf, size_t size,
                               const aarch64_opnd_info *opnd)
 {
-  const size_t tblen = 16;
-  char tb[tblen];              /* Temporary buffer.  */
+  char tb[16];                 /* Temporary buffer.  */
   bfd_boolean lsl_p = FALSE;   /* Is LSL shift operator?  */
   bfd_boolean wm_p = FALSE;    /* Should Rm be Wm?  */
   bfd_boolean print_extend_p = TRUE;
@@ -2334,9 +2333,9 @@ print_register_offset_address (char *buf, size_t size,
   if (print_extend_p)
     {
       if (print_amount_p)
-       snprintf (tb, tblen, ",%s #%d", shift_name, opnd->shifter.amount);
+       snprintf (tb, sizeof (tb), ",%s #%d", shift_name, opnd->shifter.amount);
       else
-       snprintf (tb, tblen, ",%s", shift_name);
+       snprintf (tb, sizeof (tb), ",%s", shift_name);
     }
   else
     tb[0] = '\0';