This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Can gold be compiled with gcc 3.4?
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sources dot redhat dot com
- Cc: iant at google dot com
- Date: Tue, 3 Nov 2009 10:00:22 -0800
- Subject: Can gold be compiled with gcc 3.4?
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Can gold be compiled with gcc 3.4? I got
/net/gnu-6/export/gnu/import/git/binutils/gold/dwarf_reader.cc: In
function `int64_t gold::read_signed_LEB_128(const unsigned char*,
size_t*)':
/net/gnu-6/export/gnu/import/git/binutils/gold/dwarf_reader.cc:78:
warning: 'byte' might be used uninitialized in this function
with gcc 3.4. After applying this patch, one gold test doesn't finish
after several minutes:
17950 pts/0 S 0:00 g++ -W -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFS
17951 pts/0 S 0:00 /usr/libexec/gcc/x86_64-redhat-linux/3.4.6/collect2 -
17953 pts/0 R 7:19 gcctestdir1/ld --eh-frame-hdr -m elf_x86_64 -dynamic-
Thanks.
H.J.
---
2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
* dwarf_reader.cc (read_signed_LEB_128): Silence gcc 3.4.
diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc
index d142586..9594cc7 100644
--- a/gold/dwarf_reader.cc
+++ b/gold/dwarf_reader.cc
@@ -75,7 +75,7 @@ read_signed_LEB_128(const unsigned char* buffer, size_t* len)
int64_t result = 0;
int shift = 0;
size_t num_read = 0;
- unsigned char byte;
+ unsigned char byte = 0;
do
{