From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 25 10:18:45 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 45AEF16A400 for ; Sun, 25 Mar 2007 10:18:45 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id 229D513C455 for ; Sun, 25 Mar 2007 10:18:45 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.9] (may be forged)) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2PAIi2M015462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 25 Mar 2007 03:18:44 -0700 X-Auth-Received: from [192.168.10.42] (c-67-187-172-183.hsd1.ca.comcast.net [67.187.172.183]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2PAIh42012613 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Sun, 25 Mar 2007 03:18:44 -0700 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <20070325083805.GA68655@heff.fud.org.nz> References: <20070325083805.GA68655@heff.fud.org.nz> X-Gpgmail-State: !signed Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3AD42FD0-08D2-4417-B8B4-EEC810B4F3F2@u.washington.edu> Content-Transfer-Encoding: 7bit From: Garrett Cooper Date: Sun, 25 Mar 2007 03:18:42 -0700 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.752.2) X-PMX-Version: 5.3.0.289146, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.3.25.30933 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' Subject: Re: hash.h warnings X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2007 10:18:45 -0000 On Mar 25, 2007, at 1:38 AM, Andrew Thompson wrote: > Hi, > > > There was a discussion late last year about how to fix the warnings in > sys/sys/hash.h. > > http://lists.freebsd.org/pipermail/freebsd-net/2006-October/ > 012098.html > > There were a few suggestions put forward but nothing was ever > committed. I > need to include this file in the kernel for a new driver but do not > know > enough about this type of warning to fix it. Can anyone recommend > the correct > fix? > > @/sys/hash.h: In function `hash32_stre': > @/sys/hash.h:97: warning: cast discards qualifiers from pointer > target type > @/sys/hash.h: In function `hash32_strne': > @/sys/hash.h:116: warning: cast discards qualifiers from pointer > target type > > > > cheers, > Andrew After looking at the source it appears that part of the problem stems from the fact that p is an unsigned char pointer, where ep is a signed char double pointer. So you're losing some precision in the process (hence where the error's coming from I believe). So, if you modified buf (the pointer that p is pointing to) or ep to be compatible with one another, you probably wouldn't get this warning.. -Garrett