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]
Other format: [Raw text]

more warning fixes


This cleans up all gcc4 warnings except in opcodes/ for cgen generated
files, and probably quite a few in gas/ as I haven't yet compiled all
gas targets.  I'll tackle the gas/ ones later, but am hoping someone
else will fix cgen.  If no one is interested in helping, maybe we'll
just enable -Werror anyway.  :)
Oh, and I suppose bfd/som.c will generate it's share of warnings, but
that file only compiles natively, and I'm tired of janitorial work.

binutils/
	* Makefile.am (syslex.o, sysinfo.o): Pass AM_CFLAGS to compiler.
	(syslex.o, sysinfo.o, dlltool.o, rescoff.o): Remove duplicate
	dependencies.  Run "make dep-am".
	* nlmconv.c: Warning fixes.
	* readelf.c: Likewise.
	* srconv.c: Likewise.
	* sysdump.c: Likewise.
	* sysinfo.y: Likewise.
	* syslex.l: Likewise.  Use yyleng instead of strlen, memcpy instead
	of strcpy.
	* Makefile.in: Regenerate.
gas/
	* read.c: Warning fixes.
	* config/obj-elf.c: Likewise.
gprof/
	* basic_blocks.c: Warning fixes.
	* gmon_io.c: Likewise.
	* hist.c: Likewise.
	* hist.h: Likewise.
ld/
	* ldexp.c: Warning fixes.
	* ldwrite.c: Likewise.
	* emultempl/elf32.em: Likewise.
opcodes/
	* arc-ext.c: Warning fixes.
	* arc-ext.h: Likewise.
	* cgen-opc.c: Likewise.
	* ia64-gen.c: Likewise.
	* maxq-dis.c: Likewise.
	* ns32k-dis.c: Likewise.
	* w65-dis.c: Likewise.
	* ia64-asmtab.c: Regenerate.

Index: binutils/Makefile.am
===================================================================
RCS file: /cvs/src/src/binutils/Makefile.am,v
retrieving revision 1.54
diff -u -p -r1.54 Makefile.am
--- binutils/Makefile.am	21 Feb 2005 11:48:59 -0000	1.54
+++ binutils/Makefile.am	22 Feb 2005 12:08:55 -0000
@@ -219,20 +219,20 @@ sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sy
 	./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
 
 sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
-	$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o 
+	$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
 
-syslex.o: syslex.c sysinfo.h
+syslex.o:
 	if [ -r syslex.c ]; then \
-	  $(CC_FOR_BUILD) -c -I. $(CFLAGS)  syslex.c  ; \
+	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS)  syslex.c  ; \
 	else \
-	  $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS) $(srcdir)/syslex.c ;\
+	  $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/syslex.c ;\
 	fi
 
-sysinfo.o: sysinfo.c
+sysinfo.o:
 	if [ -r sysinfo.c ]; then \
-	  $(CC_FOR_BUILD) -c -I. $(CFLAGS)  sysinfo.c  ; \
+	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS)  sysinfo.c  ; \
 	else \
-	  $(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
+	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c ; \
 	fi
 
 # We need these for parallel make.
@@ -247,10 +247,10 @@ srconv_SOURCES = srconv.c coffgrok.c $(B
 dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
 dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
 
-dlltool.o:dlltool.c
+dlltool.o:
 	$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
 
-rescoff.o:rescoff.c
+rescoff.o:
 	$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
 
 coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
@@ -544,7 +544,7 @@ arlex.o: arlex.c $(INCDIR)/ansidecl.h $(
   arparse.h
 sysroff.o: sysroff.c
 sysinfo.o: sysinfo.c
-syslex.o: syslex.c sysinfo.h
+syslex.o: syslex.c config.h sysinfo.h
 defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
   $(INCDIR)/fopen-same.h dlltool.h
Index: binutils/nlmconv.c
===================================================================
RCS file: /cvs/src/src/binutils/nlmconv.c,v
retrieving revision 1.23
diff -u -p -r1.23 nlmconv.c
--- binutils/nlmconv.c	16 Feb 2005 12:55:43 -0000	1.23
+++ binutils/nlmconv.c	22 Feb 2005 11:55:23 -0000
@@ -193,7 +193,7 @@ main (int argc, char **argv)
   bfd *sharedbfd;
   size_t shared_offset = 0;
   size_t shared_size = 0;
-  Nlm_Internal_Fixed_Header sharedhdr;
+  static Nlm_Internal_Fixed_Header sharedhdr;
   int len;
   char *modname;
   char **matching;
@@ -976,7 +976,7 @@ main (int argc, char **argv)
       for (l = modules; l != NULL; l = l->next)
 	{
 	  *set = strlen (l->string);
-	  strncpy (set + 1, l->string, *set);
+	  strncpy ((char *) set + 1, l->string, *set);
 	  set += *set + 1;
 	  ++c;
 	}
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.278
diff -u -p -r1.278 readelf.c
--- binutils/readelf.c	21 Feb 2005 02:55:56 -0000	1.278
+++ binutils/readelf.c	22 Feb 2005 11:55:28 -0000
@@ -4027,7 +4027,8 @@ process_section_groups (FILE *file)
       if (section->sh_type == SHT_GROUP)
 	{
 	  char *name = SECTION_NAME (section);
-	  char *group_name, *start, *indices;
+	  char *group_name;
+	  unsigned char *start, *indices;
 	  unsigned int entry, j, size;
 	  Elf_Internal_Shdr *sec;
 	  Elf_Internal_Sym *sym;
@@ -7011,7 +7012,7 @@ dump_section (Elf_Internal_Shdr *section
 
 
 static unsigned long int
-read_leb128 (unsigned char *data, int *length_return, int sign)
+read_leb128 (unsigned char *data, unsigned int *length_return, int sign)
 {
   unsigned long int result = 0;
   unsigned int num_read = 0;
@@ -7075,7 +7076,7 @@ static int
 process_extended_line_op (unsigned char *data, int is_stmt, int pointer_size)
 {
   unsigned char op_code;
-  int bytes_read;
+  unsigned int bytes_read;
   unsigned int len;
   unsigned char *name;
   unsigned long adr;
@@ -7445,7 +7446,7 @@ process_abbrev_section (unsigned char *s
 
   while (start < end)
     {
-      int bytes_read;
+      unsigned int bytes_read;
       unsigned long entry;
       unsigned long tag;
       unsigned long attribute;
@@ -7620,7 +7621,7 @@ decode_location_expression (unsigned cha
 			    unsigned long cu_offset)
 {
   unsigned op;
-  int bytes_read;
+  unsigned int bytes_read;
   unsigned long uvalue;
   unsigned char *end = data + length;
   int need_frame_base = 0;
@@ -7990,7 +7991,7 @@ read_and_display_attr_value (unsigned lo
 {
   unsigned long uvalue = 0;
   unsigned char *block_start = NULL;
-  int bytes_read;
+  unsigned int bytes_read;
 
   switch (form)
     {
@@ -8729,7 +8730,7 @@ process_debug_info (Elf_Internal_Shdr *s
       level = 0;
       while (tags < start)
 	{
-	  int bytes_read;
+	  unsigned int bytes_read;
 	  unsigned long abbrev_number;
 	  abbrev_entry *entry;
 	  abbrev_attr *attr;
@@ -9031,7 +9032,7 @@ display_debug_lines (Elf_Internal_Shdr *
 	  while (*data != 0)
 	    {
 	      unsigned char *name;
-	      int bytes_read;
+	      unsigned int bytes_read;
 
 	      printf (_("  %d\t"), ++state_machine_regs.last_file_entry);
 	      name = data;
@@ -9058,7 +9059,7 @@ display_debug_lines (Elf_Internal_Shdr *
 	{
 	  unsigned char op_code;
 	  int adv;
-	  int bytes_read;
+	  unsigned int bytes_read;
 
 	  op_code = *data++;
 
@@ -9306,7 +9307,7 @@ display_debug_macinfo (Elf_Internal_Shdr
 	case DW_MACINFO_define:
 	  lineno = read_leb128 (curr, & bytes_read, 0);
 	  curr += bytes_read;
-	  string = curr;
+	  string = (char *) curr;
 	  curr += strlen (string) + 1;
 	  printf (_(" DW_MACINFO_define - lineno : %d macro : %s\n"),
 		  lineno, string);
@@ -9315,7 +9316,7 @@ display_debug_macinfo (Elf_Internal_Shdr
 	case DW_MACINFO_undef:
 	  lineno = read_leb128 (curr, & bytes_read, 0);
 	  curr += bytes_read;
-	  string = curr;
+	  string = (char *) curr;
 	  curr += strlen (string) + 1;
 	  printf (_(" DW_MACINFO_undef - lineno : %d macro : %s\n"),
 		  lineno, string);
@@ -9327,7 +9328,7 @@ display_debug_macinfo (Elf_Internal_Shdr
 
 	    constant = read_leb128 (curr, & bytes_read, 0);
 	    curr += bytes_read;
-	    string = curr;
+	    string = (char *) curr;
 	    curr += strlen (string) + 1;
 	    printf (_(" DW_MACINFO_vendor_ext - constant : %d string : %s\n"),
 		    constant, string);
@@ -10006,7 +10007,7 @@ display_debug_frames (Elf_Internal_Shdr 
   Frame_Chunk *remembered_state = 0;
   Frame_Chunk *rs;
   int is_eh = streq (SECTION_NAME (section), ".eh_frame");
-  int length_return;
+  unsigned int length_return;
   int max_regs = 0;
 
   printf (_("The section %s contains:\n"), SECTION_NAME (section));
@@ -10074,8 +10075,8 @@ display_debug_frames (Elf_Internal_Shdr 
 
 	  version = *start++;
 
-	  fc->augmentation = start;
-	  start = strchr (start, '\0') + 1;
+	  fc->augmentation = (char *) start;
+	  start = (unsigned char *) strchr ((char *) start, '\0') + 1;
 
 	  if (fc->augmentation[0] == 'z')
 	    {
@@ -10151,7 +10152,7 @@ display_debug_frames (Elf_Internal_Shdr 
 	  if (augmentation_data_len)
 	    {
 	      unsigned char *p, *q;
-	      p = fc->augmentation + 1;
+	      p = (unsigned char *) fc->augmentation + 1;
 	      q = augmentation_data;
 
 	      while (1)
Index: binutils/srconv.c
===================================================================
RCS file: /cvs/src/src/binutils/srconv.c,v
retrieving revision 1.14
diff -u -p -r1.14 srconv.c
--- binutils/srconv.c	21 Jan 2005 05:40:24 -0000	1.14
+++ binutils/srconv.c	22 Feb 2005 11:55:28 -0000
@@ -46,11 +46,11 @@ static int get_member_id (int);
 static int get_ordinary_id (int);
 static char *section_translate (char *);
 static char *strip_suffix (char *);
-static void checksum (FILE *, char *, int, int);
-static void writeINT (int, char *, int *, int, FILE *);
-static void writeBITS (int, char *, int *, int);
-static void writeBARRAY (barray, char *, int *, int, FILE *);
-static void writeCHARS (char *, char *, int *, int, FILE *);
+static void checksum (FILE *, unsigned char *, int, int);
+static void writeINT (int, unsigned char *, int *, int, FILE *);
+static void writeBITS (int, unsigned char *, int *, int);
+static void writeBARRAY (barray, unsigned char *, int *, int, FILE *);
+static void writeCHARS (char *, unsigned char *, int *, int, FILE *);
 static void wr_tr (void);
 static void wr_un (struct coff_ofile *, struct coff_sfile *, int, int);
 static void wr_hd (struct coff_ofile *);
@@ -158,7 +158,7 @@ strip_suffix (char *name)
 
 /* IT LEN stuff CS */
 static void
-checksum (FILE *file, char *ptr, int size, int code)
+checksum (FILE *file, unsigned char *ptr, int size, int code)
 {
   int j;
   int last;
@@ -181,7 +181,7 @@ checksum (FILE *file, char *ptr, int siz
 
 
 static void
-writeINT (int n, char *ptr, int *idx, int size, FILE *file)
+writeINT (int n, unsigned char *ptr, int *idx, int size, FILE *file)
 {
   int byte = *idx / 8;
 
@@ -222,7 +222,7 @@ writeINT (int n, char *ptr, int *idx, in
 }
 
 static void
-writeBITS (int val, char *ptr, int *idx, int size)
+writeBITS (int val, unsigned char *ptr, int *idx, int size)
 {
   int byte = *idx / 8;
   int bit = *idx % 8;
@@ -239,8 +239,8 @@ writeBITS (int val, char *ptr, int *idx,
 }
 
 static void
-writeBARRAY (barray data, char *ptr, int *idx, int size ATTRIBUTE_UNUSED,
-	     FILE *file)
+writeBARRAY (barray data, unsigned char *ptr, int *idx,
+	     int size ATTRIBUTE_UNUSED, FILE *file)
 {
   int i;
 
@@ -250,7 +250,7 @@ writeBARRAY (barray data, char *ptr, int
 }
 
 static void
-writeCHARS (char *string, char *ptr, int *idx, int size, FILE *file)
+writeCHARS (char *string, unsigned char *ptr, int *idx, int size, FILE *file)
 {
   int i = *idx / 8;
 
Index: binutils/sysdump.c
===================================================================
RCS file: /cvs/src/src/binutils/sysdump.c,v
retrieving revision 1.12
diff -u -p -r1.12 sysdump.c
--- binutils/sysdump.c	21 Jan 2005 05:40:24 -0000	1.12
+++ binutils/sysdump.c	22 Feb 2005 11:55:28 -0000
@@ -55,10 +55,10 @@ static void module (void);
 static void show_usage (FILE *, int);
 
 extern char *getCHARS (unsigned char *, int *, int, int);
-extern int fillup (char *);
+extern int fillup (unsigned char *);
 extern barray getBARRAY (unsigned char *, int *, int, int);
 extern int getINT (unsigned char *, int *, int, int);
-extern int getBITS (char *, int *, int, int);
+extern int getBITS (unsigned char *, int *, int, int);
 extern void sysroff_swap_tr_in (void);
 extern void sysroff_print_tr_out (void);
 extern int main (int, char **);
@@ -121,7 +121,7 @@ dh (unsigned char *ptr, int size)
 }
 
 int
-fillup (char *ptr)
+fillup (unsigned char *ptr)
 {
   int size;
   int sum;
@@ -198,7 +198,7 @@ getINT (unsigned char *ptr, int *idx, in
 }
 
 int
-getBITS (char *ptr, int *idx, int size, int max)
+getBITS (unsigned char *ptr, int *idx, int size, int max)
 {
   int byte = *idx / 8;
   int bit = *idx % 8;
@@ -265,7 +265,7 @@ pbarray (barray *y)
 void
 sysroff_swap_tr_in (void)
 {
-  char raw[255];
+  unsigned char raw[255];
 
   memset (raw, 0, 255);
   fillup (raw);
Index: binutils/sysinfo.y
===================================================================
RCS file: /cvs/src/src/binutils/sysinfo.y,v
retrieving revision 1.5
diff -u -p -r1.5 sysinfo.y
--- binutils/sysinfo.y	27 Oct 2003 13:20:32 -0000	1.5
+++ binutils/sysinfo.y	22 Feb 2005 11:55:29 -0000
@@ -37,6 +37,9 @@ int rdepth;
 char *loop [] = {"","n","m","/*BAD*/"};
 char *names[] = {" ","[n]","[n][m]"};
 char *pnames[]= {"","*","**"};
+
+static int yyerror (char *s);
+extern int yylex (void);
 %}
 
 
@@ -117,7 +120,7 @@ it:
 	    printf("void sysroff_swap_%s_in(ptr)\n",$2);
 	    printf("struct IT_%s *ptr;\n", it);
 	    printf("{\n");
-	    printf("char raw[255];\n");
+	    printf("unsigned char raw[255];\n");
 	    printf("\tint idx = 0 ;\n");
 	    printf("\tint size;\n");
 	    printf("memset(raw,0,255);\n");	
@@ -129,7 +132,7 @@ it:
 	    printf("FILE * file;\n");
 	    printf("struct IT_%s *ptr;\n", it);
 	    printf("{\n");
-	    printf("\tchar raw[255];\n");
+	    printf("\tunsigned char raw[255];\n");
 	    printf("\tint idx = 16 ;\n");
 	    printf("\tmemset (raw, 0, 255);\n");
 	    printf("\tcode = IT_%s_CODE;\n", it);
@@ -431,7 +434,7 @@ if (writecode == 'd')
 return 0;
 }
 
-int
+static int
 yyerror (char *s)
 {
   fprintf(stderr, "%s\n" , s);
Index: binutils/syslex.l
===================================================================
RCS file: /cvs/src/src/binutils/syslex.l,v
retrieving revision 1.3
diff -u -p -r1.3 syslex.l
--- binutils/syslex.l	14 Sep 2003 12:20:17 -0000	1.3
+++ binutils/syslex.l	22 Feb 2005 11:55:29 -0000
@@ -18,14 +18,26 @@ along with GLD; see the file COPYING.  I
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
+#include "config.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include "sysinfo.h"
 char *word;
 int number;
 int unit;
 
+#define YY_NO_UNPUT
+
 #ifndef yywrap
 static int yywrap (void) { return 1; }
 #endif
+
+extern int yylex (void);
 %}
 %%
 "(" { return '(';}
@@ -37,9 +49,9 @@ static int yywrap (void) { return 1; }
 "\t" { ; }
 "\n" { ; }
 "\""[^\"]*"\"" {
-yylval.s = malloc(strlen (yytext));
-strcpy(yylval.s, yytext+1);
-yylval.s[strlen(yylval.s)-1] = 0;
+	yylval.s = malloc (yyleng - 1);
+	memcpy (yylval.s, yytext + 1, yyleng - 2);
+	yylval.s[yyleng - 2] = '\0';
         return NAME;
 	}
 
Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.91
diff -u -p -r1.91 read.c
--- gas/read.c	21 Feb 2005 08:39:52 -0000	1.91
+++ gas/read.c	22 Feb 2005 11:55:36 -0000
@@ -4410,7 +4410,7 @@ void
 emit_leb128_expr (expressionS *exp, int sign)
 {
   operatorT op = exp->X_op;
-  int nbytes;
+  unsigned int nbytes;
 
   if (op == O_absent || op == O_illegal)
     {
@@ -4442,7 +4442,7 @@ emit_leb128_expr (expressionS *exp, int 
 
   /* Let check_eh_frame know that data is being emitted.  nbytes == -1 is
      a signal that this is leb128 data.  It shouldn't optimize this away.  */
-  nbytes = -1;
+  nbytes = (unsigned int) -1;
   if (check_eh_frame (exp, &nbytes))
     abort ();
 
Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.90
diff -u -p -r1.90 obj-elf.c
--- gas/config/obj-elf.c	17 Feb 2005 13:46:03 -0000	1.90
+++ gas/config/obj-elf.c	22 Feb 2005 11:55:40 -0000
@@ -1936,7 +1936,7 @@ elf_frob_file (void)
 
       size = 4 * (list.elt_count[i] + 1);
       bfd_set_section_size (stdoutput, s, size);
-      s->contents = frag_more (size);
+      s->contents = (unsigned char *) frag_more (size);
       frag_now->fr_fix = frag_now_fix_octets ();
     }
 
Index: gprof/basic_blocks.c
===================================================================
RCS file: /cvs/src/src/gprof/basic_blocks.c,v
retrieving revision 1.11
diff -u -p -r1.11 basic_blocks.c
--- gprof/basic_blocks.c	26 May 2004 04:55:55 -0000	1.11
+++ gprof/basic_blocks.c	22 Feb 2005 11:55:45 -0000
@@ -118,7 +118,7 @@ fskip_string (FILE *fp)
 void
 bb_read_rec (FILE *ifp, const char *filename)
 {
-  int nblocks, b;
+  unsigned int nblocks, b;
   bfd_vma addr, ncalls;
   Sym *sym;
 
Index: gprof/gmon_io.c
===================================================================
RCS file: /cvs/src/src/gprof/gmon_io.c,v
retrieving revision 1.18
diff -u -p -r1.18 gmon_io.c
--- gprof/gmon_io.c	26 May 2004 04:55:55 -0000	1.18
+++ gprof/gmon_io.c	22 Feb 2005 11:55:53 -0000
@@ -378,15 +378,16 @@ gmon_out_read (const char *filename)
       {
 	bfd_vma low_pc;
 	bfd_vma high_pc;
-	int ncnt;
+	unsigned int ncnt;
       };
-      int i, samp_bytes, header_size = 0;
+      unsigned int i;
+      int samp_bytes, header_size = 0;
       unsigned long count;
       bfd_vma from_pc, self_pc;
       static struct hdr h;
       UNIT raw_bin_count;
       struct hdr tmp;
-      int version;
+      unsigned int version;
 
       /* Information from a gmon.out file is in two parts: an array of
 	 sampling hits within pc ranges, and the arcs.  */
@@ -419,7 +420,7 @@ gmon_out_read (const char *filename)
 
       if (version == GMONVERSION)
 	{
-	  int profrate;
+	  unsigned int profrate;
 
 	  /* 4.4BSD format header.  */
           if (gmon_io_read_32 (ifp, &profrate))
@@ -427,7 +428,7 @@ gmon_out_read (const char *filename)
 
 	  if (!s_highpc)
 	    hz = profrate;
-	  else if (hz != profrate)
+	  else if (hz != (int) profrate)
 	    {
 	      fprintf (stderr,
 		       _("%s: profiling rate incompatible with first gmon file\n"),
@@ -630,7 +631,7 @@ gmon_out_write (const char *filename)
   else if (file_format == FF_BSD || file_format == FF_BSD44)
     {
       UNIT raw_bin_count;
-      int i, hdrsize;
+      unsigned int i, hdrsize;
       unsigned padsize;
       char pad[3*4];
       Arc *arc;
Index: gprof/hist.c
===================================================================
RCS file: /cvs/src/src/gprof/hist.c,v
retrieving revision 1.11
diff -u -p -r1.11 hist.c
--- gprof/hist.c	26 May 2004 04:55:55 -0000	1.11
+++ gprof/hist.c	22 Feb 2005 11:55:53 -0000
@@ -44,7 +44,7 @@ extern void flat_blurb (FILE * fp);
 bfd_vma s_lowpc;		/* Lowest address in .text.  */
 bfd_vma s_highpc = 0;		/* Highest address in .text.  */
 bfd_vma lowpc, highpc;		/* Same, but expressed in UNITs.  */
-int hist_num_bins = 0;		/* Number of histogram samples.  */
+unsigned int hist_num_bins = 0;	/* Number of histogram samples.  */
 int *hist_sample = 0;		/* Histogram samples (shorts in the file!).  */
 double hist_scale;
 char hist_dimension[16] = "seconds";
@@ -83,7 +83,7 @@ void
 hist_read_rec (FILE * ifp, const char *filename)
 {
   bfd_vma n_lowpc, n_highpc;
-  int i, ncnt, profrate;
+  unsigned int i, ncnt, profrate;
   UNIT count;
 
   if (gmon_io_read_vma (ifp, &n_lowpc)
@@ -111,16 +111,16 @@ hist_read_rec (FILE * ifp, const char *f
     }
 
   DBG (SAMPLEDEBUG,
-       printf ("[hist_read_rec] n_lowpc 0x%lx n_highpc 0x%lx ncnt %d\n",
+       printf ("[hist_read_rec] n_lowpc 0x%lx n_highpc 0x%lx ncnt %u\n",
 	       (unsigned long) n_lowpc, (unsigned long) n_highpc, ncnt);
-       printf ("[hist_read_rec] s_lowpc 0x%lx s_highpc 0x%lx nsamples %d\n",
+       printf ("[hist_read_rec] s_lowpc 0x%lx s_highpc 0x%lx nsamples %u\n",
 	       (unsigned long) s_lowpc, (unsigned long) s_highpc,
 	       hist_num_bins);
        printf ("[hist_read_rec]   lowpc 0x%lx   highpc 0x%lx\n",
 	       (unsigned long) lowpc, (unsigned long) highpc));
 
   if (n_lowpc != s_lowpc || n_highpc != s_highpc
-      || ncnt != hist_num_bins || hz != profrate)
+      || ncnt != hist_num_bins || hz != (int) profrate)
     {
       fprintf (stderr, _("%s: `%s' is incompatible with first gmon file\n"),
 	       whoami, filename);
@@ -138,7 +138,7 @@ hist_read_rec (FILE * ifp, const char *f
       if (fread (&count[0], sizeof (count), 1, ifp) != 1)
 	{
 	  fprintf (stderr,
-		  _("%s: %s: unexpected EOF after reading %d of %d samples\n"),
+		  _("%s: %s: unexpected EOF after reading %u of %u samples\n"),
 		   whoami, filename, i, hist_num_bins);
 	  done (1);
 	}
@@ -158,7 +158,7 @@ void
 hist_write_hist (FILE * ofp, const char *filename)
 {
   UNIT count;
-  int i;
+  unsigned int i;
 
   /* Write header.  */
 
@@ -263,8 +263,8 @@ hist_assign_samples ()
   bfd_vma bin_low_pc, bin_high_pc;
   bfd_vma sym_low_pc, sym_high_pc;
   bfd_vma overlap, addr;
-  int bin_count, i;
-  unsigned int j;
+  unsigned int bin_count;
+  unsigned int i, j;
   double time, credit;
 
   /* Read samples and assign to symbols.  */
@@ -285,7 +285,7 @@ hist_assign_samples ()
 
       DBG (SAMPLEDEBUG,
 	   printf (
-      "[assign_samples] bin_low_pc=0x%lx, bin_high_pc=0x%lx, bin_count=%d\n",
+      "[assign_samples] bin_low_pc=0x%lx, bin_high_pc=0x%lx, bin_count=%u\n",
 		    (unsigned long) (sizeof (UNIT) * bin_low_pc),
 		    (unsigned long) (sizeof (UNIT) * bin_high_pc),
 		    bin_count));
Index: gprof/hist.h
===================================================================
RCS file: /cvs/src/src/gprof/hist.h,v
retrieving revision 1.6
diff -u -p -r1.6 hist.h
--- gprof/hist.h	26 May 2004 04:55:55 -0000	1.6
+++ gprof/hist.h	22 Feb 2005 11:55:53 -0000
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suit
 extern bfd_vma s_lowpc;		/* Lowpc from the profile file.  */
 extern bfd_vma s_highpc;	/* Highpc from the profile file.  */
 extern bfd_vma lowpc, highpc;	/* Range profiled, in UNIT's.  */
-extern int hist_num_bins;	/* Number of histogram bins.  */
+extern unsigned int hist_num_bins; /* Number of histogram bins.  */
 extern int *hist_sample;	/* Code histogram.  */
 
 /* Scale factor converting samples to pc values:
Index: ld/ldexp.c
===================================================================
RCS file: /cvs/src/src/ld/ldexp.c,v
retrieving revision 1.44
diff -u -p -r1.44 ldexp.c
--- ld/ldexp.c	17 Feb 2005 20:57:00 -0000	1.44
+++ ld/ldexp.c	22 Feb 2005 11:55:54 -0000
@@ -1115,7 +1115,7 @@ exp_get_fill (etree_type *tree,
       fill = xmalloc ((len + 1) / 2 + sizeof (*fill) - 1);
       fill->size = (len + 1) / 2;
       dst = fill->data;
-      s = r.str;
+      s = (unsigned char *) r.str;
       val = 0;
       do
 	{
Index: ld/ldwrite.c
===================================================================
RCS file: /cvs/src/src/ld/ldwrite.c,v
retrieving revision 1.18
diff -u -p -r1.18 ldwrite.c
--- ld/ldwrite.c	24 Jun 2004 04:46:27 -0000	1.18
+++ ld/ldwrite.c	22 Feb 2005 11:55:54 -0000
@@ -242,7 +242,7 @@ build_link_order (lang_statement_union_t
 		     is going to be output, we'll change it into a
 		     fill.  */
 		  link_order->type = bfd_data_link_order;
-		  link_order->u.data.contents = "";
+		  link_order->u.data.contents = (unsigned char *) "";
 		  link_order->u.data.size = 1;
 		}
 	      else
Index: ld/emultempl/elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.130
diff -u -p -r1.130 elf32.em
--- ld/emultempl/elf32.em	16 Feb 2005 07:49:26 -0000	1.130
+++ ld/emultempl/elf32.em	22 Feb 2005 11:55:54 -0000
@@ -1017,8 +1017,8 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" != 
     ELF_INTERPRETER_SET_DEFAULT="
   if (sinterp != NULL)
     {
-      sinterp->contents = ${ELF_INTERPRETER_NAME};
-      sinterp->size = strlen (sinterp->contents) + 1;
+      sinterp->contents = (unsigned char *) ${ELF_INTERPRETER_NAME};
+      sinterp->size = strlen ((char *) sinterp->contents) + 1;
     }
 
 "
Index: opcodes/arc-ext.c
===================================================================
RCS file: /cvs/src/src/opcodes/arc-ext.c,v
retrieving revision 1.4
diff -u -p -r1.4 arc-ext.c
--- opcodes/arc-ext.c	15 Jun 2004 01:14:22 -0000	1.4
+++ opcodes/arc-ext.c	22 Feb 2005 11:56:03 -0000
@@ -58,7 +58,7 @@ arcExtMap_coreRegName(int value)
 {
   if (value < 32)
     return 0;
-  return (const char *) arc_extension_map.coreRegisters[value-32];
+  return arc_extension_map.coreRegisters[value-32];
 }
 
 /* Get the name of an extension condition code.  */
@@ -68,7 +68,7 @@ arcExtMap_condCodeName(int value)
 {
   if (value < 16)
     return 0;
-  return (const char *) arc_extension_map.condCodes[value-16];
+  return arc_extension_map.condCodes[value-16];
 }
 
 /* Get the name of an extension aux register.  */
@@ -187,7 +187,7 @@ arcExtMap_add(void *base, unsigned long 
 	    else
 	      opcode -= 0x10;
 	    insn -> flags = (char) *(p+4);
-	    strcpy(insn_name, (p+5));
+	    strcpy (insn_name, (char *) (p+5));
 	    insn -> name = insn_name;
 	    arc_extension_map.instructions[(int) opcode] = insn;
 	  }
@@ -197,7 +197,7 @@ arcExtMap_add(void *base, unsigned long 
 	  {
 	    char * core_name = (char *) xmalloc(((int)*p-3) * sizeof(char));
 
-	    strcpy(core_name, (p+3));
+	    strcpy(core_name, (char *) (p+3));
 	    arc_extension_map.coreRegisters[p[2]-32] = core_name;
 	  }
 	  break;
@@ -205,7 +205,7 @@ arcExtMap_add(void *base, unsigned long 
 	case EXT_COND_CODE:
 	  {
 	    char * cc_name = (char *) xmalloc( ((int)*p-3) * sizeof(char));
-	    strcpy(cc_name, (p+3));
+	    strcpy(cc_name, (char *) (p+3));
 	    arc_extension_map.condCodes[p[2]-16] = cc_name;
 	  }
 	  break;
@@ -217,7 +217,7 @@ arcExtMap_add(void *base, unsigned long 
 	      (struct ExtAuxRegister *)malloc(sizeof(struct ExtAuxRegister));
 	    char * aux_name = (char *) xmalloc ( ((int)*p-6) * sizeof(char));
 
-	    strcpy (aux_name, (p+6));
+	    strcpy (aux_name, (char *) (p+6));
 	    newAuxRegister->name = aux_name;
 	    newAuxRegister->address = p[2]<<24 | p[3]<<16 | p[4]<<8  | p[5];
 	    newAuxRegister->next = arc_extension_map.auxRegisters;
Index: opcodes/arc-ext.h
===================================================================
RCS file: /cvs/src/src/opcodes/arc-ext.h,v
retrieving revision 1.2
diff -u -p -r1.2 arc-ext.h
--- opcodes/arc-ext.h	13 Mar 2001 22:58:34 -0000	1.2
+++ opcodes/arc-ext.h	22 Feb 2005 11:56:03 -0000
@@ -20,10 +20,10 @@ Foundation, Inc., 59 Temple Place - Suit
 #ifndef ARCEXT_H
 #define ARCEXT_H
 
-enum {EXT_INSTRUCTION   = 0};
-enum {EXT_CORE_REGISTER = 1};
-enum {EXT_AUX_REGISTER  = 2};
-enum {EXT_COND_CODE     = 3};
+enum {EXT_INSTRUCTION   = 0,
+      EXT_CORE_REGISTER = 1,
+      EXT_AUX_REGISTER  = 2,
+      EXT_COND_CODE     = 3};
 
 enum {NUM_EXT_INST = (0x1f-0x10+1) + (0x3f-0x09+1)};
 enum {NUM_EXT_CORE = 59-32+1};
@@ -46,8 +46,8 @@ struct arcExtMap 
 {
   struct ExtAuxRegister *auxRegisters;
   struct ExtInstruction *instructions[NUM_EXT_INST];
-  unsigned char *coreRegisters[NUM_EXT_CORE];
-  unsigned char *condCodes[NUM_EXT_COND];
+  char *coreRegisters[NUM_EXT_CORE];
+  char *condCodes[NUM_EXT_COND];
 };
 
 extern int arcExtMap_add(void*, unsigned long);
Index: opcodes/cgen-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-opc.c,v
retrieving revision 1.12
diff -u -p -r1.12 cgen-opc.c
--- opcodes/cgen-opc.c	8 Aug 2003 21:21:24 -0000	1.12
+++ opcodes/cgen-opc.c	22 Feb 2005 11:56:07 -0000
@@ -483,7 +483,7 @@ cgen_lookup_insn (CGEN_CPU_DESC cd,
       /* The instructions are stored in hash lists.
 	 Pick the first one and keep trying until we find the right one.  */
 
-      insn_list = cgen_dis_lookup_insn (cd, buf, base_insn);
+      insn_list = cgen_dis_lookup_insn (cd, (char *) buf, base_insn);
       while (insn_list != NULL)
 	{
 	  insn = insn_list->insn;
Index: opcodes/ia64-gen.c
===================================================================
RCS file: /cvs/src/src/opcodes/ia64-gen.c,v
retrieving revision 1.13
diff -u -p -r1.13 ia64-gen.c
--- opcodes/ia64-gen.c	31 Jan 2005 08:48:32 -0000	1.13
+++ opcodes/ia64-gen.c	22 Feb 2005 11:56:13 -0000
@@ -1570,7 +1570,7 @@ print_dependency_table ()
   for (i=0;i < dlistlen;i++)
     {
       int len = 2;
-      printf ("static const short dep%d[] = {\n  ", i);
+      printf ("static const unsigned short dep%d[] = {\n  ", i);
       for (j=0;j < dlists[i]->len; j++)
         {
           len += printf ("%d, ", dlists[i]->deps[j]);
@@ -1913,7 +1913,7 @@ gen_dis_table (ent)
   if ((needed_bytes + insn_list_len) > tot_insn_list_len)
     {
       tot_insn_list_len += 256;
-      insn_list = (char *) xrealloc (insn_list, tot_insn_list_len);
+      insn_list = (unsigned char *) xrealloc (insn_list, tot_insn_list_len);
     }
   our_offset = insn_list_len;
   insn_list_len += needed_bytes;
@@ -2064,7 +2064,7 @@ gen_dis_table (ent)
 	  /* Store the address of the entry being branched to.  */
 	  while (currbits >= 0)
 	    {
-	      char *byte = insn_list + our_offset + bitsused / 8;
+	      unsigned char *byte = insn_list + our_offset + bitsused / 8;
 
 	      if (idest & (1 << currbits))
 		*byte |= (1 << (7 - (bitsused % 8)));
Index: opcodes/maxq-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/maxq-dis.c,v
retrieving revision 1.2
diff -u -p -r1.2 maxq-dis.c
--- opcodes/maxq-dis.c	19 Nov 2004 12:34:13 -0000	1.2
+++ opcodes/maxq-dis.c	22 Feb 2005 11:56:13 -0000
@@ -145,9 +145,9 @@ unsigned char const SIM_ALU_DECODE_POP_O
 unsigned char const SIM_ALU_DECODE_CMP_SRC_OP_GROUP = 11;
 
 /* GLOBAL */
-unsigned char unres_reg_name[20];
+char unres_reg_name[20];
 
-static unsigned char *
+static char *
 get_reg_name (unsigned char reg_code, type1 arg_pos)
 {
   unsigned char module;
Index: opcodes/ns32k-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/ns32k-dis.c,v
retrieving revision 1.6
diff -u -p -r1.6 ns32k-dis.c
--- opcodes/ns32k-dis.c	16 Dec 2002 09:54:12 -0000	1.6
+++ opcodes/ns32k-dis.c	22 Feb 2005 11:56:14 -0000
@@ -33,12 +33,12 @@ static disassemble_info *dis_info;
 /*
  * Hacks to get it to compile <= READ THESE AS FIXES NEEDED
  */
-#define INVALID_FLOAT(val, size) invalid_float((char *)val, size)
+#define INVALID_FLOAT(val, size) invalid_float((bfd_byte *)val, size)
 
 static int print_insn_arg
-  PARAMS ((int, int, int *, char *, bfd_vma, char *, int));
-static int get_displacement PARAMS ((char *, int *));
-static int invalid_float PARAMS ((char *, int));
+  PARAMS ((int, int, int *, bfd_byte *, bfd_vma, char *, int));
+static int get_displacement PARAMS ((bfd_byte *, int *));
+static int invalid_float PARAMS ((bfd_byte *, int));
 static long int read_memory_integer PARAMS ((unsigned char *, int));
 static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *));
 struct ns32k_option;
@@ -46,7 +46,7 @@ static void optlist PARAMS ((int, const 
 static void list_search PARAMS ((int, const struct ns32k_option *, char *));
 static int bit_extract PARAMS ((bfd_byte *, int, int));
 static int bit_extract_simple PARAMS ((bfd_byte *, int, int));
-static void bit_copy PARAMS ((char *, int, int, char *));
+static void bit_copy PARAMS ((bfd_byte *, int, int, char *));
 static int sign_extend PARAMS ((int, int));
 static void flip_bytes PARAMS ((char *, int));
 
@@ -340,7 +340,7 @@ bit_extract_simple (buffer, offset, coun
 
 static void
 bit_copy (buffer, offset, count, to)
-     char *buffer;
+     bfd_byte *buffer;
      int offset;
      int count;
      char *to;
@@ -551,7 +551,7 @@ static int
 print_insn_arg (d, ioffset, aoffsetp, buffer, addr, result, index_offset)
      int d;
      int ioffset, *aoffsetp;
-     char *buffer;
+     bfd_byte *buffer;
      bfd_vma addr;
      char *result;
      int index_offset;
@@ -827,7 +827,7 @@ print_insn_arg (d, ioffset, aoffsetp, bu
 
 static int
 get_displacement (buffer, aoffsetp)
-     char *buffer;
+     bfd_byte *buffer;
      int *aoffsetp;
 {
   int Ivalue;
@@ -861,7 +861,7 @@ get_displacement (buffer, aoffsetp)
 #if 1 /* a version that should work on ns32k f's&d's on any machine */
 static int
 invalid_float (p, len)
-     register char *p;
+     register bfd_byte *p;
      register int len;
 {
   register int val;
Index: opcodes/w65-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/w65-dis.c,v
retrieving revision 1.6
diff -u -p -r1.6 w65-dis.c
--- opcodes/w65-dis.c	2 Dec 2002 13:13:37 -0000	1.6
+++ opcodes/w65-dis.c	22 Feb 2005 11:56:14 -0000
@@ -27,7 +27,7 @@ static fprintf_ftype fpr;
 static void *stream;
 static struct disassemble_info *local_info;
 
-static void print_operand PARAMS ((int, char *, unsigned int *));
+static void print_operand PARAMS ((int, char *, int *));
 
 #if 0
 static char *lname[] = { "r0","r1","r2","r3","r4","r5","r6","r7","s0" };
@@ -45,7 +45,7 @@ static void
 print_operand (lookup, format, args)
      int lookup;
      char *format;
-     unsigned int *args;
+     int *args;
 {
   int val;
   int c;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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