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]

readelf.c won't compile with HP-UX 11.00's cc


Mainline readelf.c contains invalid C code.  The result of a type cast
isn't an lvalue, but we pass the result of a cast to GET_DATA_ALLOC as
the `var' argument, that is assigned to.  This compiles with GCC, as
an extension, but some other compilers barf.  This patch fixes it so
that it compiles.  Ok to install?

Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.91
diff -u -p -r1.91 readelf.c
--- binutils/readelf.c 2001/02/11 23:11:39 1.91
+++ binutils/readelf.c 2001/02/28 00:57:53
@@ -3391,8 +3391,8 @@ process_unwind (file)
 
 	  strsec = section_headers + sec->sh_link;
 	  aux.strtab_size = strsec->sh_size;
-	  GET_DATA_ALLOC (strsec->sh_offset, aux.strtab_size,
-			  (char *) aux.strtab, char *, "string table");
+	  GET_DATA_ALLOC (strsec->sh_offset, aux.strtab_size, aux.strtab,
+			  char *, "string table");
 	}
       else if (sec->sh_type == SHT_IA_64_UNWIND)
 	unwsec = sec;

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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