This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to change hashtab.h hashval_t to size_t
- From: DJ Delorie <dj at redhat dot com>
- To: ghazi at caip dot rutgers dot edu
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 9 Oct 2002 13:50:07 -0400
- Subject: Re: Patch to change hashtab.h hashval_t to size_t
- References: <200210091738.NAA20401@caip.rutgers.edu>
> Ok to install?
No.
> -typedef unsigned int hashval_t;
> +typedef size_t hashval_t;
Changing the size of hashval_t would break backward compatibility,
especially on LP64 systems. IMHO if gcc is getting a warning because
it's casting a pointer to an integer, gcc is doing something wrong and
it's up to gcc to work around it.
> Using size_t instead seems to be the generally accepted way within
> our sources to ensure casting between pointers and integers aren't
> truncated.
The hash functions will truncate it anyway, so this argument seems
very weak to me.
Plus this header is used for more than just gcc - it's also used for
bfd, which is often installed as a shared object. You can't just make
arbitrary changes to files in include/*.h.