Liste des Groupes | Revenir à cl c |
On 24/05/2024 02:39, Tim Rentsch wrote:
>Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:>
>On 24/05/2024 00:52, Tim Rentsch wrote:>
>Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:>
>On 23/05/2024 23:49, Tim Rentsch wrote:>
>Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:>
>What is a good hash function for pointers to use in portable>
ANSI C?
I have a preliminary question. Do you really mean ANSI C, or
is C99 acceptable?
C89 is better.
But the pass has been sold.
I'm not asking which you think is better. I'm asking about
what your requirements are.
C 89.
I don't want to pull in C99 types and so on just for a hash
function.
In that case I think you are stuck with using a half-baked
solution. The standard integer types available in C89 just
aren't a good fit in a 64-bit world.
I assume the C89 implementation is one that can target current 64
bit machines.
>
Then char, short, int, long long will almost certainly have widths
of 8, 16, 32 and 64 bits respectively.
(I don't know if 'long long' was part of C89, but it sounds like
Malcolm just doesn't want to be bothered with stdint.h, and any
compiler used is like to support it.
Les messages affichés proviennent d'usenet.