This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to change hashtab.h hashval_t to size_t


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]