Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2003 12:03:35 -0700
From:      Tim Kientzle <kientzle@acm.org>
To:        David Leimbach <leimy2k@mac.com>
Cc:        current@freebsd.org
Subject:   Re: what is the suggested way to do void * arithmetic ?
Message-ID:  <3F0DB887.1080504@acm.org>
References:  <6006001.1057858723473.JavaMail.leimy2k@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
David Leimbach wrote:
> I think C takes a more low-level approach and says "void * is just an address
> void * + 1 means the next valid address".

This is not true.

The ANSI C standard forbids arithmetic on void * pointers,
just as C++ does.

GNU gcc has supported void * arithmetic for a long
time as an extension, but it's not standard behavior
and you should not rely on it.

Tim Kientzle




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