From owner-freebsd-current@FreeBSD.ORG Fri Jul 11 03:02:10 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 5C8C337B404 for ; Fri, 11 Jul 2003 03:02:10 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8425143FCB for ; Fri, 11 Jul 2003 03:02:09 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from dialup-67.30.108.143.dial1.sanjose1.level3.net ([67.30.108.143] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19aujA-0000h3-00; Fri, 11 Jul 2003 03:02:09 -0700 Message-ID: <3F0E8A1F.FFFA7D4A@mindspring.com> Date: Fri, 11 Jul 2003 02:57:51 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Luigi Rizzo References: <20030710011956.A61125@xorpc.icir.org> <3F0D42FC.81DECF87@mindspring.com> <20030710094056.A73538@xorpc.icir.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a485e462d6acaeb68a0db83e78127fa03d350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c 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 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2003 10:02:10 -0000 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