This is the mail archive of the 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]

[buildrobot] readelf.c (decode_arm_unwind): Initialise addr structure

Hi Nick!

Buildrobot found this:

libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -o addr2line addr2line.o bucomm.o version.o filemode.o  ../bfd/.libs/libbfd.a ../libiberty/libiberty.a -lz
gcc -DHAVE_CONFIG_H -I. -I/home/jbglaw/repos/binutils/binutils  -I. -I/home/jbglaw/repos/binutils/binutils -I../bfd -I/home/jbglaw/repos/binutils/binutils/../bfd -I/home/jbglaw/repos/binutils/binutils/../include -DLOCALEDIR="\"/home/jbglaw/build/mipsel-linux/_install_/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT readelf.o -MD -MP -MF .deps/readelf.Tpo -c -o readelf.o /home/jbglaw/repos/binutils/binutils/readelf.c
cc1: warnings being treated as errors
/home/jbglaw/repos/binutils/binutils/readelf.c: In function âdecode_arm_unwindâ:
/home/jbglaw/repos/binutils/binutils/readelf.c:7173: error: missing initializer
/home/jbglaw/repos/binutils/binutils/readelf.c:7173: error: (near initialization for âaddr.offsetâ)
make[3]: *** [readelf.o] Error 1

 5803 struct absaddr
 5804   {
 5805     unsigned short section;
 5806     bfd_vma offset;
 5807   };
 7173   struct absaddr addr = { 0 };

I don't really see why GCC complains about it (and not init's `offset' with 0,
although you probably wanted to init offset instead of section.) And
it's only GCCs on some of the builders, not on all. See :

gcc110:  no complains:gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)
pluto:   no complains:gcc (Debian 4.8.1-7) 4.8.1
gccbuild:no complains:gcc (Debian 4.8.1-7) 4.8.1
darkeye: no complains:gcc (Debian 4.8.1-7) 4.8.1

gcc15:   complains:   gcc (Debian 4.4.5-8) 4.4.5
gcc76:   complains:   gcc (Debian 4.4.5-8) 4.4.5

Looks like a compiler bug to me, uncovered by the recent partial
initialization of `addr'. Is it actually needed? `addr' is fully
initialized in get_unwind_section_word(). So I guess removing the
(incomplete) initializer isn't wrong and would remove the build


2013-10-14  Jan-Benedict Glaw  <>

	* readelf.c (decode_arm_unwind): Don't initialize `addr'.

diff --git a/binutils/readelf.c b/binutils/readelf.c
index 32e0cf0..2156b78 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -7170,7 +7170,7 @@ decode_arm_unwind (struct arm_unw_aux_info *  aux,
   int per_index;
   unsigned int more_words = 0;
-  struct absaddr addr = { 0 };
+  struct absaddr addr;
   bfd_vma sym_name = (bfd_vma) -1;
   if (remaining == 0)


      Jan-Benedict Glaw              +49-172-7608481
Signature of:                 Friends are relatives you make for yourself.
the second  :

Attachment: signature.asc
Description: Digital signature

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