Liste des Groupes | Revenir à cl c |
On 24/05/2024 00:52, Tim Rentsch wrote:Tim is right that the <stdint.h> types are /vastly/ better for this sort of thing. And you won't find any C89/C90 compilers that don't support <stdint.h> even in C89/C90 mode. You might choose to avoid other C99 features, in case you have any users that insist on C89/C90, but you can't get anywhere with just the standard C89/C90 types. On a platform such as 64-bit Windows, pointers are 64-bit but the biggest C89/C90 integer type is "unsigned long", which is 32-bit on that platform. You can't get at the upper bits of the pointer without compiler-specific extensions - and if you allow extensions, you might as well allow <stdint.h> and make life far simpler for everyone.Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:C 89.
>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.
I don't want to pull in C99 types and so on just for a hash function.
Les messages affichés proviennent d'usenet.