Re: [PATCH][2.4.28-pre3] USB drivers gcc-3.4 fixes

From: Alan Cox
Date: Mon Sep 13 2004 - 07:00:11 EST


On Llu, 2004-09-13 at 01:30, Pete Zaitcev wrote:
> > size -= pgrem;
> > - (char *)buffer += pgrem;
> > + buffer += pgrem;
>
> I'm pretty sure it's done that way on purpose. There were compilers which
> did not allow any arithmetics on void*, and it had to be cast to char*.
> So perhaps it's correct for 2.6, which requires gcc 3 anyway, but I have
> my doubts about applicability of this to 2.4.

Should be ok for the 2.* gcc we support. (BTW is anyone using anything
less than 2.95 nowdays because we've still got 2.7.* workarounds in
asm-i386/semaphore.h !)

Otherwise in "valid" C it's

buffer = ((char *)buffer) + pgrem;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/