From owner-freebsd-current@FreeBSD.ORG Thu Jul 10 12:06:24 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 5CF0737B40F for ; Thu, 10 Jul 2003 12:06:24 -0700 (PDT) Received: from smtp5.Stanford.EDU (smtp5.Stanford.EDU [171.67.16.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7ACF743FA3 for ; Thu, 10 Jul 2003 12:06:21 -0700 (PDT) (envelope-from verm@spill.tendra.org) Received: (from root@localhost) by smtp5.Stanford.EDU (8.12.9/8.12.9) id h6AJ6LnA021693 for current@freebsd.org; Thu, 10 Jul 2003 12:06:21 -0700 (PDT) Received: from spill.tendra.org (tendra.Stanford.EDU [171.64.127.144]) by smtp5.Stanford.EDU (8.12.9/8.12.9) with ESMTP id h6AJ6IKq021686 for ; Thu, 10 Jul 2003 12:06:18 -0700 (PDT) Received: from spill.tendra.org (localhost.tendra.org [127.0.0.1]) by spill.tendra.org (8.12.9/8.12.5) with ESMTP id h6AJ6IRR012888 for ; Thu, 10 Jul 2003 12:06:18 -0700 (PDT) (envelope-from verm@spill.tendra.org) Received: (from verm@localhost) by spill.tendra.org (8.12.9/8.12.9/Submit) id h6AJ6Ik9012887 for current@freebsd.org; Thu, 10 Jul 2003 12:06:18 -0700 (PDT) Date: Thu, 10 Jul 2003 12:06:18 -0700 From: Amar Takhar To: current@freebsd.org Message-ID: <20030710190618.GA12850@tendra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F0DB887.1080504@acm.org> User-Agent: Mutt/1.5.1i 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 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:06:24 -0000 On 2003-07-10 12:03 -0700, Tim Kientzle wrote: > 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. Yes, please don't it'll just make things harder for TenDRA in the future :) <-goes back to his cave. Amar.