Re: cdb++ on a 64-bit machine?

Matthias Andree <[email protected]> Sat, 12 Apr 2003 11:35:39 +0200
Newsgroups gmane.comp.djb.cdb
Message-ID <[email protected]>
Jeff King <[email protected]> writes:

> Sort of. The correct header is actually <stdint.h> (though inttypes.h is
> guaranteed by POSIX to include stdint.h). <stdint.h> is POSIX and C99
> compliant, but not C89 (I don't believe -- no copy of the standard
> handy).

Well you aren't getting anywhere with your Unix software when
constraining yourself to C89 or C99. You will also need to look at the
"extensions" such as POSIX :-)

stdint.h a relatively new header. IEEE 1003.1-2001 in fact talks of
stdint.h as a SUBSET of inttypes.h, being "more suitable for use in
free-standing environments".

The (1997) Single Unix Specification v2 didn't mention stdint.h, and
instead had "The <inttypes.h> header includes definitions of at least
the following types: (...)" with a list of -- among others -- int32_t
and uint32_t.

Practically, I've tried to go with stdint.h for bogofilter, but I found
too few systems supported it, so I just include inttypes.h where it's
present and try some compile-time tests to figure a uint32_t if
inttypes.h is not present. Haven't yet received uint32_t portability
complaints.

(Interestingly, the splint code checker chokes on u_int32_t which is
used by the BerkeleyDB library -- maybe BSD relics. Nevermind,
-Du_int32_t=uint32_t works for splint.)

-- 
Matthias Andree