]> git.draconx.ca Git - cdecl99.git/commitdiff
libcdecl: Replace uintmax_t with unsigned (long) long.
authorNick Bowler <nbowler@draconx.ca>
Thu, 18 Jan 2024 05:17:06 +0000 (00:17 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 19 Jan 2024 01:39:21 +0000 (20:39 -0500)
Using uintmax_t in a public header file is problematic.  The most
obvious problem is that we need to include either <inttypes.h> or
<stdint.h> to get it, and the current unconditional inclusion of
<stdint.h> breaks on e.g., HP-UX 11 which only has <inttypes.h>

The less obvious problem is that uintmax_t can depend on compiler
configuration, e.g., the Sun compiler for a 32-bit host provides a
32-bit uintmax_t in C89 mode.

Instead, just change it to "unsigned long long" if supported, otherwise
"unsigned long".  It is very likely to be binary compatible with prior
releases, since as far as I am aware prior releases don't actually build
on any implementation where it would not be the case.


No differences found