[PATCH] Improve portability
Mike Frysinger
vapier at gentoo.org
Sun Sep 6 06:59:59 UTC 2009
On Sunday 06 September 2009 02:57:26 Dan Fandrich wrote:
> 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).
i'm not really interested in what random compilers allow -- what does the spec
say ? my understanding is that math on a void pointer should be the same as a
number.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090906/650e1316/attachment.pgp>
More information about the busybox
mailing list