This is the mail archive of the binutils@sources.redhat.com 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]

[rfa] config/tc-mn10300.c fix GCC warnings


Hello,

The attatched cleans up a few GCC warnings.  For the most part I don't
think there will be problems (BUT).

The function md_estimate_size_before_relax() could in theory fall off
the end without returning a value.  I added an abort() for that case. 
Does someone have a better suggestion?

	Andrew
Thu Jul 27 11:25:01 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* config/tc-mn10300.c (md_convert_frag): Fix printfs.
	(tc_gen_reloc): Add cast when assigning bfd_abs_symbol to
 	sym_ptr_ptr
	(md_estimate_size_before_relax): Don't fall off end of function.

Index: config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.8
diff -p -r1.8 tc-mn10300.c
*** tc-mn10300.c	2000/07/17 21:06:14	1.8
--- tc-mn10300.c	2000/07/27 03:45:20
*************** md_convert_frag (abfd, sec, fragP)
*** 659,665 ****
        fragP->fr_literal[offset] = opcode;
  
        /* Create a fixup for the reversed conditional branch.  */
!       sprintf (buf, ".%s_%d", FAKE_LABEL_NAME, label_count++);
        fix_new (fragP, fragP->fr_fix + 1, 1,
  	       symbol_new (buf, sec, 0, fragP->fr_next),
  	       fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
--- 659,665 ----
        fragP->fr_literal[offset] = opcode;
  
        /* Create a fixup for the reversed conditional branch.  */
!       sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++);
        fix_new (fragP, fragP->fr_fix + 1, 1,
  	       symbol_new (buf, sec, 0, fragP->fr_next),
  	       fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
*************** md_convert_frag (abfd, sec, fragP)
*** 716,722 ****
        fragP->fr_literal[offset] = opcode;
  
        /* Create a fixup for the reversed conditional branch.  */
!       sprintf (buf, ".%s_%d", FAKE_LABEL_NAME, label_count++);
        fix_new (fragP, fragP->fr_fix + 1, 1,
  	       symbol_new (buf, sec, 0, fragP->fr_next),
  	       fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
--- 716,722 ----
        fragP->fr_literal[offset] = opcode;
  
        /* Create a fixup for the reversed conditional branch.  */
!       sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++);
        fix_new (fragP, fragP->fr_fix + 1, 1,
  	       symbol_new (buf, sec, 0, fragP->fr_next),
  	       fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
*************** md_convert_frag (abfd, sec, fragP)
*** 762,768 ****
        fragP->fr_literal[offset + 1] = opcode;
  
        /* Create a fixup for the reversed conditional branch.  */
!       sprintf (buf, ".%s_%d", FAKE_LABEL_NAME, label_count++);
        fix_new (fragP, fragP->fr_fix + 2, 1,
  	       symbol_new (buf, sec, 0, fragP->fr_next),
  	       fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL);
--- 762,768 ----
        fragP->fr_literal[offset + 1] = opcode;
  
        /* Create a fixup for the reversed conditional branch.  */
!       sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++);
        fix_new (fragP, fragP->fr_fix + 2, 1,
  	       symbol_new (buf, sec, 0, fragP->fr_next),
  	       fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL);
*************** md_convert_frag (abfd, sec, fragP)
*** 798,804 ****
        fragP->fr_literal[offset + 1] = opcode;
  
        /* Create a fixup for the reversed conditional branch.  */
!       sprintf (buf, ".%s_%d", FAKE_LABEL_NAME, label_count++);
        fix_new (fragP, fragP->fr_fix + 2, 1,
  	       symbol_new (buf, sec, 0, fragP->fr_next),
  	       fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL);
--- 798,804 ----
        fragP->fr_literal[offset + 1] = opcode;
  
        /* Create a fixup for the reversed conditional branch.  */
!       sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++);
        fix_new (fragP, fragP->fr_fix + 2, 1,
  	       symbol_new (buf, sec, 0, fragP->fr_next),
  	       fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL);
*************** tc_gen_reloc (seg, fixp)
*** 1841,1847 ****
  	  return NULL;
  	}
  
!       reloc->sym_ptr_ptr = &bfd_abs_symbol;
        reloc->addend = (S_GET_VALUE (fixp->fx_addsy)
  		       - S_GET_VALUE (fixp->fx_subsy) + fixp->fx_offset);
      }
--- 1841,1847 ----
  	  return NULL;
  	}
  
!       reloc->sym_ptr_ptr = (asymbol **) &bfd_abs_symbol;
        reloc->addend = (S_GET_VALUE (fixp->fx_addsy)
  		       - S_GET_VALUE (fixp->fx_subsy) + fixp->fx_offset);
      }
*************** md_estimate_size_before_relax (fragp, se
*** 1896,1901 ****
--- 1896,1902 ----
        else
  	return 2;
      }
+   abort ();
  }
  
  long

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