[PATCH] Improve portability
Dan Fandrich
dan at coneharvesters.com
Sun Sep 6 06:57:26 UTC 2009
On Sun, Sep 06, 2009 at 02:34:30AM -0400, Mike Frysinger wrote:
> On Saturday 05 September 2009 15:13:56 Dan Fandrich wrote:
> > --- a/archival/gzip.c
> > +++ b/archival/gzip.c
> > - SET_PTR_TO_GLOBALS(xzalloc(......
> > + SET_PTR_TO_GLOBALS((void *)((char *)xzalloc(......
>
> i cant see how casting a function that already returns a (void *) "improves"
> anything. the opposite should be done in general -- drop useless casts.
> unfortunately, it seems like Denys already merged this part.
The problem is that adding an offset to a void* isn't allowed by some
compilers, which makes some sense since a void* has no inherent size to
use when doing pointer arithmetic. Some compilers treat a void* as a char*
for these purposes, but not all (e.g. OpenWatcom).
>>> Dan
--
http://www.MoveAnnouncer.com The web change of address service
Let webmasters know that your web site has moved
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 288 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090905/b81830bb/attachment.pgp>
More information about the busybox
mailing list