This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[RFA:] Compilation warning fixes for tc-sh.c
- To: binutils at sourceware dot cygnus dot com
- Subject: [RFA:] Compilation warning fixes for tc-sh.c
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- Date: Sun, 26 Nov 2000 14:43:18 -0500 (EST)
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