This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

[PATCH, Committed] Remove compile time warnings


The bfin port binutils cannot be compiled using gcc 4.0.x because of
some signedness warnings. This patch remove these warnings.

This patch also rename bfin-parse.tab.h to bfin-parse.h, which is more
consistent with bfin-parse.c.

According to Ian's email on EXTRA_DIST
<http://sourceware.org/ml/binutils/2005-10/msg00095.html>,
bfin-parse.h and bfin-lex.c should be in EXTRA_DIST, This patch adds
them.

Jie
bfd/
	* elf32-bfin.c (bfd_bfin_elf32_create_embedded_relocs): Fix signedness
	warning.
gas/
	* Makefile.am (bfin-parse.h): Renamed from bfin-parse.tab.h.
	(EXTRA_DIST): Add bfin-parse.h and bfin-lex.c.
	* Makefile.in: Regenerate.
	* config/bfin-lex.l: Include bfin-parse.h instead of bfin-parse.tab.h.
	* config/tc-bfin.c (md_chars_to_number): Change the type of first
	argument from unsigned char * to char * to remove signedness warnings.

Index: bfd/elf32-bfin.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-bfin.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-bfin.c
--- bfd/elf32-bfin.c	24 Oct 2005 14:25:13 -0000	1.2
+++ bfd/elf32-bfin.c	24 Oct 2005 15:42:26 -0000
@@ -2764,7 +2764,7 @@ bfd_bfin_elf32_create_embedded_relocs (
       bfd_put_32 (abfd, irel->r_offset + datasec->output_offset, p);
       memset (p + 4, 0, 8);
       if (targetsec != NULL)
-	strncpy (p + 4, targetsec->output_section->name, 8);
+	strncpy ((char *) p + 4, targetsec->output_section->name, 8);
     }
 
   if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf)
Index: gas/Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.122
diff -u -p -r1.122 Makefile.am
--- gas/Makefile.am	18 Oct 2005 16:10:59 -0000	1.122
+++ gas/Makefile.am	24 Oct 2005 15:42:26 -0000
@@ -441,7 +441,7 @@ noinst_SCRIPTS = $(GDBINIT)
 EXTRA_SCRIPTS = .gdbinit
 
 EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
-	bfin-parse.c
+	bfin-parse.c bfin-parse.h bfin-lex.c
 
 diststuff: $(EXTRA_DIST) info
 all: info
@@ -606,15 +606,15 @@ m68k-parse.h: ; @true
 $(srcdir)/config/m68k-parse.h: ; @true
 
 bfin-parse.c bfin-parse.tab.h: $(srcdir)/config/bfin-parse.y
-	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.tab.h -- $(YACCCOMPILE) -d ;
-bfin-parse.o: bfin-parse.c bfin-parse.tab.h $(srcdir)/config/bfin-defs.h
+	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
+bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h
 
 bfin-defs.h: ; @true
 $(srcdir)/config/bfin-defs.h: ; @true
 
 bfin-lex.c: $(srcdir)/config/bfin-lex.l
 	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
-bfin-lex.o: bfin-lex.c bfin-parse.tab.h $(srcdir)/config/bfin-defs.h
+bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
 	$(COMPILE) -c $< $(NO_WERROR)
 
 # The instruction table specification lexical analyzer and parser.
Index: gas/Makefile.in
===================================================================
RCS file: /cvs/src/src/gas/Makefile.in,v
retrieving revision 1.133
diff -u -p -r1.133 Makefile.in
--- gas/Makefile.in	18 Oct 2005 16:10:59 -0000	1.133
+++ gas/Makefile.in	24 Oct 2005 15:42:26 -0000
@@ -661,7 +661,7 @@ POTFILES = $(MULTI_CFILES) $(TARGET_ENV_
 noinst_SCRIPTS = $(GDBINIT)
 EXTRA_SCRIPTS = .gdbinit
 EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
-	bfin-parse.c
+	bfin-parse.c bfin-parse.h bfin-lex.c
 
 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
 
@@ -3135,15 +3135,15 @@ m68k-parse.h: ; @true
 $(srcdir)/config/m68k-parse.h: ; @true
 
 bfin-parse.c bfin-parse.tab.h: $(srcdir)/config/bfin-parse.y
-	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.tab.h -- $(YACCCOMPILE) -d ;
-bfin-parse.o: bfin-parse.c bfin-parse.tab.h $(srcdir)/config/bfin-defs.h
+	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
+bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h
 
 bfin-defs.h: ; @true
 $(srcdir)/config/bfin-defs.h: ; @true
 
 bfin-lex.c: $(srcdir)/config/bfin-lex.l
 	$(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
-bfin-lex.o: bfin-lex.c bfin-parse.tab.h $(srcdir)/config/bfin-defs.h
+bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
 	$(COMPILE) -c $< $(NO_WERROR)
 
 # The instruction table specification lexical analyzer and parser.
Index: gas/config/bfin-lex.l
===================================================================
RCS file: /cvs/src/src/gas/config/bfin-lex.l,v
retrieving revision 1.1
diff -u -p -r1.1 bfin-lex.l
--- gas/config/bfin-lex.l	30 Sep 2005 15:05:06 -0000	1.1
+++ gas/config/bfin-lex.l	24 Oct 2005 15:42:26 -0000
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "bfin-defs.h"
-#include "bfin-parse.tab.h"
+#include "bfin-parse.h"
 #include "as.h"
 
 static long parse_int (char **end);
Index: gas/config/tc-bfin.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-bfin.c,v
retrieving revision 1.2
diff -u -p -r1.2 tc-bfin.c
--- gas/config/tc-bfin.c	19 Oct 2005 13:15:01 -0000	1.2
+++ gas/config/tc-bfin.c	24 Oct 2005 15:42:27 -0000
@@ -36,7 +36,7 @@ extern YY_BUFFER_STATE yy_scan_string (c
 extern void yy_delete_buffer (YY_BUFFER_STATE b);
 static parse_state parse (char *line);
 static void bfin_s_bss PARAMS ((int));
-static int md_chars_to_number PARAMS ((unsigned char *, int));
+static int md_chars_to_number PARAMS ((char *, int));
 
 /* Global variables. */
 struct bfin_insn *insn;
@@ -453,9 +453,7 @@ md_estimate_size_before_relax (fragS * f
 /* Convert from target byte order to host byte order.  */
 
 static int
-md_chars_to_number (val, n)
-     unsigned char *val;	/* Value in target byte order.  */
-     int n;			/* Number of bytes in the input.  */
+md_chars_to_number (char *val, int n)
 {
   int retval;
 

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