From owner-freebsd-current@FreeBSD.ORG Thu Jul 10 12:00:44 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6330137B401 for ; Thu, 10 Jul 2003 12:00:44 -0700 (PDT) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B81A43F75 for ; Thu, 10 Jul 2003 12:00:43 -0700 (PDT) (envelope-from kientzle@acm.org) Received: from acm.org ([66.166.149.53]) by kientzle.com (8.12.9/8.12.9) with ESMTP id h6AJ0hgY011387; Thu, 10 Jul 2003 12:00:43 -0700 (PDT) (envelope-from kientzle@acm.org) Message-ID: <3F0DB887.1080504@acm.org> Date: Thu, 10 Jul 2003 12:03:35 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.1) Gecko/20021005 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Leimbach References: <6006001.1057858723473.JavaMail.leimy2k@mac.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Luigi Rizzo cc: current@freebsd.org Subject: Re: what is the suggested way to do void * arithmetic ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2003 19:00:44 -0000 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