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:] Compilation warning fixes for tc-sh.c


Fixing some compilation warnings:

src/gas/config/tc-sh.c: In function `sh_elf_cons':
src/gas/config/tc-sh.c:391: warning: array subscript has type `char'
src/gas/config/tc-sh.c: In function `md_assemble':
src/gas/config/tc-sh.c:1870: warning: `size' might be used uninitialized in this function
src/gas/config/tc-sh.c: In function `md_section_align':
src/gas/config/tc-sh.c:2514: warning: unused parameter `seg'

I didn't find it obvious that size was *not* used uninitialized.  The
other fixes I don't think need to be explained further.

Ok to commit?

	* config/tc-sh.c (sh_elf_cons): Cast *input_line_pointer to
	unsigned char when indexing is_end_of_line.
	(md_assemble): Initialize size to 0.
	(md_section_align): Mark parameter seg as unused.

Index: tc-sh.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.c,v
retrieving revision 1.28
diff -p -c -r1.28 tc-sh.c
*** tc-sh.c	2000/11/17 08:47:52	1.28
--- tc-sh.c	2000/11/26 19:21:54
*************** sh_elf_cons (nbytes)
*** 388,394 ****
    input_line_pointer--;		/* Put terminator back into stream.  */
    if (*input_line_pointer == '#' || *input_line_pointer == '!')
      {
!        while (! is_end_of_line[*input_line_pointer++]);
      }
    else
      demand_empty_rest_of_line ();
--- 388,394 ----
    input_line_pointer--;		/* Put terminator back into stream.  */
    if (*input_line_pointer == '#' || *input_line_pointer == '!')
      {
!        while (! is_end_of_line[(unsigned char) *input_line_pointer++]);
      }
    else
      demand_empty_rest_of_line ();
*************** md_assemble (str)
*** 1861,1867 ****
    unsigned char *op_end;
    sh_operand_info operand[3];
    sh_opcode_info *opcode;
!   unsigned int size;
  
    opcode = find_cooked_opcode (&str);
    op_end = str;
--- 1867,1873 ----
    unsigned char *op_end;
    sh_operand_info operand[3];
    sh_opcode_info *opcode;
!   unsigned int size = 0;
  
    opcode = find_cooked_opcode (&str);
    op_end = str;
*************** md_convert_frag (headers, seg, fragP)
*** 2500,2506 ****
  
  valueT
  md_section_align (seg, size)
!      segT seg;
       valueT size;
  {
  #ifdef BFD_ASSEMBLER
--- 2511,2517 ----
  
  valueT
  md_section_align (seg, size)
!      segT seg ATTRIBUTE_UNUSED;
       valueT size;
  {
  #ifdef BFD_ASSEMBLER

brgds, H-P


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