Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Mar 2007 03:18:42 -0700
From:      Garrett Cooper <youshi10@u.washington.edu>
To:        freebsd-hackers@freebsd.org
Subject:   Re: hash.h warnings
Message-ID:  <3AD42FD0-08D2-4417-B8B4-EEC810B4F3F2@u.washington.edu>
In-Reply-To: <20070325083805.GA68655@heff.fud.org.nz>
References:  <20070325083805.GA68655@heff.fud.org.nz>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AD42FD0-08D2-4417-B8B4-EEC810B4F3F2>