1. What is the correct (portable?) way of specifying 64-bit constants?
If I need a 64-bit constant set to all 1s, will the following work on
all systems
unit64_t num = 0xffffffffffffffffULL;
(Well, uint64_t.) This will work on anything NetBSD runs on. I'm not
sure whether unsigned long long is guaranteed by C to be at least 64
bits wide. (Those versions of C that _have_ unsigned long long, that
is; it's a relatively recent addition to the language.)
You might want to write ~0ULL instead; it's smaller and somewhat
clearer. (Just looking at what you wrote, I have to count characters
to tell you didn't write 0xfffffffffffffffULL instead, for example.)