Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2003 02:57:51 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Luigi Rizzo <rizzo@icir.org>
Cc:        current@freebsd.org
Subject:   Re: what is the suggested way to do void * arithmetic ?
Message-ID:  <3F0E8A1F.FFFA7D4A@mindspring.com>
References:  <20030710011956.A61125@xorpc.icir.org> <3F0D42FC.81DECF87@mindspring.com> <20030710094056.A73538@xorpc.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Luigi Rizzo wrote:
> > I don't understand the second one.  The first one blows up because
> > you aren't parenthesizing, e.g.:
> >
> >       next = (void *)(p + len);
> >
> > The compiler is complaining because it doesn't know sizeof(*((void *)0))
> 
> ok, it actually evaluates to 1 and i thought it was some standard, probably
> it is not so i guess i have to cast to (char *) instead

THat's what I meant -- "char *", not "char"; sorry for any confusion.

-- Terry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F0E8A1F.FFFA7D4A>