Word size assumptions

Eric S. Raymond esr at thyrsus.com
Fri Sep 23 19:56:32 UTC 2016


Gary E. Miller <gem at rellim.com>:
> In C, ints are not guaranteed to be longer than 16 bits.

True, but 32-bit or larger ints is one of our baseline assumptions.

From hacking.txt:

    Do not bake in any assumptions about 32-vs-64-bit word size.  It is OK
    to assume the code will never run on a 16-bit machine.  When in doubt,
    use the fixed-width integral types from <stdint.h>.

If you want to argue for a different policy, go ahead, but you have
some mountains to climb.

One is that newer parts of the codebase we inherited (including the
protocol machine) assume at least 32-bit ints - noticing that is why I
put that text in there.

You are excused for not knowing this, because older parts of the code
did show some traces of trying to be 16-bit-clean.  It's easy to look
at those and believe that the entire Classic codebase had that property,
but no.  In that respect, bit-rot set in before the earliest commit in
our repository.

Secondly, I plain don't believe we'll ever need to target a 16-bitter.
If Classic ever successfully did that it was a very long time ago,
like multiple decades.  If you want to convince me that *we* should at
this late date, I want to see you cite a specific embedded system and
toolchain, then make a case for why we need to support that platform.

It would be pretty hellish to try to even audit for the 32-bit-minimum
assumption, let alone fix it.  I could do it, but I'd need a damn good
reason to try and I don't see one.  A huge pile of money on the table
might be motivating; I can't imagine much else that would be.

None of this is to say that I'm not interested in embedded deployments,
it's just that I don't think 16 bits is plausible even there anymore. not
for anything you'd want to put NTP on. Seriously, where are there any
16-bit UDP stacks?  Don't just handwave, show me.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: not available
URL: <http://lists.ntpsec.org/pipermail/devel/attachments/20160923/7e9c341b/attachment.bin>


More information about the devel mailing list