This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about building hash values from pointers
- From: Kai Tietz <Kai dot Tietz at onevision dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, Richard Guenther <richard dot guenther at gmail dot com>
- Date: Fri, 30 May 2008 12:19:02 +0200
- Subject: Re: Question about building hash values from pointers
Andrew Haley <aph@redhat.com> wrote on 30.05.2008 12:07:49:
> Richard Guenther wrote:
> > On Fri, May 30, 2008 at 10:57 AM, Kai Tietz <Kai.Tietz@onevision.com>
wrote:
> >> Hi,
> >>
> >> as I noticed, most hash value calculations are trying to use pointer
> >> values for building the value and assume that a long/unsigned long
scalar
> >> is wide enough for a pointer. This is at least for w64 target not
true. So
> >> I want to know, if it would be good to introduce an gcc specific type
for
> >> those kind of casts, or to use ssize_t/size_t.?
> >
> > it's uintptr_t which should be used, if only as an intermediate cast -
> > (unsigned long)(uintptr_t)ptr.
>
> That's not possible because, IIRC, gcc must compile on C90 systems.
Right, so the only type remaining is size_t. IIRC there is problem for
this type on some targets, too. AFAIC there are 24-bit pointers ...
This is the reason, why I was querying to introduce a new general type for
such stuff in gcc.
Kai
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.