Patch for bfd/cache.c - explicit cast to void*
Sun Mar 1 09:43:00 GMT 2009
Hello Alan and thanks for answering
OK, to make it more simple - this will also work and is maybe better:
chunk_nread = cache_bread_1(abfd, (void*)((char*)buf + nread), chunk_size);
Attached patch file with new suggestion
> -----Original Message-----
> From: firstname.lastname@example.org [mailto:email@example.com]
> On Behalf Of Alan Modra
> Sent: Sunday, March 01, 2009 12:33 AM
> To: Jerker Bäck
> Cc: firstname.lastname@example.org
> Subject: Re: Patch for bfd/cache.c - explicit cast to void*
> On Sat, Feb 28, 2009 at 07:46:53PM +0100, Jerker Bäck wrote:
> > I suggest the attached patch to bfd/cache.c.
> > This patch gives explicit cast from integer value to void*.
> > -chunk_nread = cache_bread_1(abfd, (char*)buf + nread, chunk_size);
> > +chunk_nread = cache_bread_1(abfd, (void*)((file_ptr)buf + nread),
> > chunk_size);
> > My compiler refuse to compile the current source - just to make it work.
> I don't see why you need this. "buf" is a void *,
> "(char *) buf + nread" is a char *, which should be acceptable as a
> void * parameter to cache_bread_1 without an explicit case. In fact,
> adding a file_ptr cast might well introduce a warning about casting
> a pointer to a different size integer.
> Alan Modra
> Australia Development Lab, IBM
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 792 bytes
Desc: not available
More information about the Binutils