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]

PATCH Fix objdump.c warning


On Windows, I get this error on build with GCC 3.4.3.

gcc -DHAVE_CONFIG_H -I.
-I/aaronwl/cs/compilers/binutils/src/cvs/src/binutils -I
. -D_GNU_SOURCE -I.
-I/aaronwl/cs/compilers/binutils/src/cvs/src/binutils -I../b
fd -I/aaronwl/cs/compilers/binutils/src/cvs/src/binutils/../bfd
-I/aaronwl/cs/co
mpilers/binutils/src/cvs/src/binutils/../include -D__USE_MINGW_FSEEK
-I/aaronwl/
cs/compilers/binutils/src/cvs/src/binutils/../intl -I../intl
-DLOCALEDIR="\"/aar
onwl/cs/env/mingw-head/20040323/share/locale\""
-Dbin_dummy_emulation=bin_vanill
a_emulation   -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror
-g -O2
-c  /aaronwl/cs/compilers/binutils/src/cvs/src/binutils/objdump.c
/aaronwl/cs/compilers/binutils/src/cvs/src/binutils/objdump.c: In
function `disa
ssemble_bytes':
/aaronwl/cs/compilers/binutils/src/cvs/src/binutils/objdump.c:1379:
warning: der
eferencing type-punned pointer will break strict-aliasing rules
make[4]: *** [objdump.o] Error 1


The warning appears to be spurious, but just removing the unneeded cast
makes it go away.  OK?
2005-03-24  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>

	* objdump.c (disassemble_bytes): Remove cast.

Index: objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.102
diff -c -3 -p -r1.102 objdump.c
*** objdump.c	18 Mar 2005 16:28:13 -0000	1.102
--- objdump.c	25 Mar 2005 00:31:21 -0000
*************** disassemble_bytes (struct disassemble_in
*** 1376,1382 ****
  	    {
  	      sfile.pos = 0;
  	      info->fprintf_func = (fprintf_ftype) objdump_sprintf;
! 	      info->stream = (FILE *) &sfile;
  	      info->bytes_per_line = 0;
  	      info->bytes_per_chunk = 0;
  	      info->flags = 0;
--- 1376,1382 ----
  	    {
  	      sfile.pos = 0;
  	      info->fprintf_func = (fprintf_ftype) objdump_sprintf;
! 	      info->stream = &sfile;
  	      info->bytes_per_line = 0;
  	      info->bytes_per_chunk = 0;
  	      info->flags = 0;

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