This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Feedback after compiling with GCC and ICC
- From: Alan Modra <amodra at gmail dot com>
- To: Greg Czajkowski <gregczajkowski at yahoo dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 22 Oct 2012 15:27:01 +1030
- Subject: Re: Feedback after compiling with GCC and ICC
- References: <1349388920.11786.YahooMailNeo@web141003.mail.bf1.yahoo.com>
On Thu, Oct 04, 2012 at 03:15:20PM -0700, Greg Czajkowski wrote:
> Hi all. Tried to build binutils 2.22 with GCC4.2.2, GCC4.7.0, ICC12.1.3 on SUSE10 and here are the results..
[snip]
> i386-dis.c: In function 'print_insn':
> i386-dis.c:11334:17: error: array subscript is above array bounds [-Werror=array-bounds]
Already fixed mainline.
> ICC 12.1.3 compiles with these patches
> cache.c(440): error #1338: arithmetic on pointer to void or function type
> ??????????? ret += offset & pagesize_m1;
Fixed with this patch.
> config/tc-i386.c(1200): error #175: subscript out of range
> ??????? if (x->array[2])
I'm not going to change this one. The compiler really ought to be
able to see that the code is dead.
> > diff ld/ldlang.c? ../binutils-2.22.icc/ld/ldlang.c
> 3216c3216
> < open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode)
> ---
> > open_input_bfds (lang_statement_union_type *s, int mode)
> 3249c3249
> <??????????????????????????????? mode | OPEN_BFD_FORCE);
> ---
> >??????????????????????????????? mode | 1);
Huh? What's wrong with using the enum?
> > diff ld/plugin.c? ../binutils-2.22.icc/ld/plugin.c
> 801c801
> <?????? ld_plugin_onload onloadfn = dlsym (curplug->dlhandle, "onload");
> ---
> >?????? ld_plugin_onload onloadfn =
> (ld_plugin_onload) dlsym (curplug->dlhandle, "onload");
> 803c803
> <?????? onloadfn = dlsym (curplug->dlhandle, "_onload");
> ---
> >?????? onloadfn = (ld_plugin_onload) dlsym (curplug->dlhandle, "_onload");
Fixed with this patch and committed mainline.
bfd/
* cache.c (cache_bmmap): Don't use void* arithmetic.
ld/
* plugin.c (plugin_load_plugins): Warning fix.
Index: bfd/cache.c
===================================================================
RCS file: /cvs/src/src/bfd/cache.c,v
retrieving revision 1.41
diff -u -p -r1.41 cache.c
--- bfd/cache.c 13 Jul 2012 14:22:42 -0000 1.41
+++ bfd/cache.c 22 Oct 2012 04:40:24 -0000
@@ -437,7 +437,7 @@ cache_bmmap (struct bfd *abfd ATTRIBUTE_
{
*map_addr = ret;
*map_len = pg_len;
- ret += offset & pagesize_m1;
+ ret = (char *) ret + (offset & pagesize_m1);
}
}
#endif
Index: ld/plugin.c
===================================================================
RCS file: /cvs/src/src/ld/plugin.c,v
retrieving revision 1.45
diff -u -p -r1.45 plugin.c
--- ld/plugin.c 14 Jun 2012 23:44:38 -0000 1.45
+++ ld/plugin.c 22 Oct 2012 04:40:31 -0000
@@ -800,9 +800,11 @@ plugin_load_plugins (void)
while (curplug)
{
enum ld_plugin_status rv;
- ld_plugin_onload onloadfn = dlsym (curplug->dlhandle, "onload");
+ ld_plugin_onload onloadfn;
+
+ onloadfn = (ld_plugin_onload) dlsym (curplug->dlhandle, "onload");
if (!onloadfn)
- onloadfn = dlsym (curplug->dlhandle, "_onload");
+ onloadfn = (ld_plugin_onload) dlsym (curplug->dlhandle, "_onload");
if (!onloadfn)
return set_plugin_error (curplug->name);
set_tv_plugin_args (curplug, &my_tv[tv_header_size]);
--
Alan Modra
Australia Development Lab, IBM