]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix more unused variable warnings
authorAlan Modra <amodra@gmail.com>
Fri, 18 Jul 2025 07:23:38 +0000 (16:53 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 18 Jul 2025 07:54:51 +0000 (17:24 +0930)
gas/config/tc-cr16.c
gas/config/tc-mn10200.c
gas/config/tc-v850.c
gas/config/tc-xgate.c
gas/config/tc-z8k.c
gas/ecoff.c
gas/write.c

index 99bc1bdd506e1f0d2a86dc38b06946a4f320346e..f2d110868f8058714f35e59828d285ffa4e406a1 100644 (file)
@@ -119,7 +119,6 @@ const size_t md_longopts_size = sizeof (md_longopts);
 static void
 l_cons (int nbytes)
 {
-  int c;
   expressionS exp;
 
 #ifdef md_flush_pending_output
@@ -141,7 +140,6 @@ l_cons (int nbytes)
   md_cons_align (nbytes);
 #endif
 
-  c = 0;
   do
     {
       unsigned int bits_available = BITS_PER_CHAR * nbytes;
@@ -236,7 +234,6 @@ l_cons (int nbytes)
       if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c'))
        code_label = 1;
       emit_expr (&exp, nbytes);
-      ++c;
       if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c'))
        {
          input_line_pointer +=3;
index 1eb470295a4430cd58426e61ab4182bcc4bd4a94..fe54d2161eb1a702362bd8804265db1115626a31 100644 (file)
@@ -896,7 +896,6 @@ md_assemble (char *str)
   for (;;)
     {
       const char *errmsg = NULL;
-      int op_idx;
       char *hold;
       int extra_shift = 0;
 
@@ -906,9 +905,9 @@ md_assemble (char *str)
       next_opindex = 0;
       insn = opcode->opcode;
       extension = 0;
-      for (op_idx = 1, opindex_ptr = opcode->operands;
+      for (opindex_ptr = opcode->operands;
           *opindex_ptr != 0;
-          opindex_ptr++, op_idx++)
+          opindex_ptr++)
        {
          const struct mn10200_operand *operand;
          expressionS ex;
index f73c3bfbab33de548f26201d2ef0a346091b67cd..176910dfaffd9b2e79243d043eb1adfe441c1036 100644 (file)
@@ -344,15 +344,10 @@ v850_comm (int area)
          int old_subsec;
          char *pfrag;
          int align;
-         flagword applicable;
 
          old_sec = now_seg;
          old_subsec = now_subseg;
 
-         applicable = bfd_applicable_section_flags (stdoutput);
-
-         applicable &= SEC_ALLOC;
-
          switch (area)
            {
            case SCOMMON_SECTION:
index 0823ecd93a4e82d99966b7d53cd543e9c53c8734..4a7829f4e60488d5cc18de7f5b964c162f9e04de 100644 (file)
@@ -1123,7 +1123,6 @@ xgate_scan_operands (struct xgate_opcode *opcode, s_operand oprs[])
   unsigned short oper_mask = 0;
   int operand_bit_length = 0;
   unsigned int operand = 0;
-  char n_operand_bits = 0;
   char first_operand_equals_second = 0;
   int i = 0;
   char c = 0;
@@ -1139,7 +1138,6 @@ xgate_scan_operands (struct xgate_opcode *opcode, s_operand oprs[])
        {
          oper_mask <<= 1;
          oper_mask += 1;
-         n_operand_bits++;
        }
     }
 
index 2980cffd59a545f78f0db67503b32fb409eedd4e..83a732f1335fdf2f21cb6ff129803cf3d23749ff 100644 (file)
@@ -1032,7 +1032,6 @@ build_bytes (opcode_entry_type *this_try, struct z8k_op *operand ATTRIBUTE_UNUSE
 {
   unsigned char *output_ptr = buffer;
   int c;
-  int nibble;
   unsigned int *class_ptr;
 
   frag_wane (frag_now);
@@ -1044,7 +1043,7 @@ build_bytes (opcode_entry_type *this_try, struct z8k_op *operand ATTRIBUTE_UNUSE
   memset (buffer, 0, sizeof (buffer));
   class_ptr = this_try->byte_info;
 
-  for (nibble = 0; (c = *class_ptr++); nibble++)
+  while ((c = *class_ptr++) != 0)
     {
 
       switch (c & CLASS_MASK)
index 74115959f94183a8b3890fab9b4a4770ad891d74..97b909364a930ddd40423d01d0ab073a67cb6cba 100644 (file)
@@ -3606,7 +3606,6 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
   efdr_t *file;
   proc_t *proc;
   unsigned long c;
-  long iline;
   long totcount;
   lineno_list_t first;
   lineno_list_t *local_first_lineno = first_lineno;
@@ -3620,7 +3619,6 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
   proc = NULL;
   last = NULL;
   c = offset;
-  iline = 0;
   totcount = 0;
 
   /* FIXME?  Now that MIPS embedded-PIC is gone, it may be safe to
@@ -3800,7 +3798,6 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
          ++c;
        }
 
-      ++iline;
       last = l;
     }
 
index 455dc446a01b738e406e0bc6cc8c6be698d8c8f2..c56ad28ea51c1e4f61d0840b38c6e6d61b886574 100644 (file)
@@ -2242,7 +2242,7 @@ write_object_file (void)
        char *table_ptr;
        addressT table_addr;
        addressT from_addr, to_addr;
-       int n, m;
+       int n;
 
        subseg_change (lie->seg, lie->subseg);
        fragP = lie->dispfrag;
@@ -2267,9 +2267,9 @@ write_object_file (void)
        table_ptr += md_short_jump_size;
        table_addr += md_short_jump_size;
 
-       for (m = 0;
+       for (;
             lie && lie->dispfrag == fragP;
-            m++, lie = lie->next_broken_word)
+            lie = lie->next_broken_word)
          {
            if (lie->added == 2)
              continue;