Or, of course,
you could just not even pretend to write portably.
Sometimes that's a right answer; [...]
I'm writing device drivers and comm
protocols for industrial control
systems. These boards will be made by the hundreds of thousands and
will never run any other processor.
Yup, that is one of those "sometimes". Or, at least, it can be; I've
seen "it'll never run on anything else" code ported to the next
hardware rev with great pain often enough that I'd be hesitant to write
that way myself, but sometimes such porting is unlikely enough that
paying the cost for it if-and-when is preferable to paying the
immediate costs of preparing for it now. And you are the one in a
position to estimate those things in this case, not me.
Further, code I wrote 25 years ago in C, using
"unsigned int" and
"unsigned short" all over the place, works just friggin' fine.
Yeah, me too. Well, some of it; I've perpetrated enough disasters in
my time....
Do not make the mistake of assuming that I don't
know this language,
and don't make the mistake of assuming that anyone who doesn't use
this "uint32_t" noise is automatically writing inherently
non-portable code.
No, I don't make either of those assumptions. Nor am I writing
specifically to you in most of the arguments I make in this thread.
Portability is a matter of degree, not an absolute all-or-nothing
thing; neither is it a thing that can be conjured up by mechanical
application of any rules (like "use uint*_t") or wrecked by ignoring
them. It requires awareness of what the language does and doesn't
promise and thought about how that interacts with the assumptions your
code is making.
Not that I think _you_ need to be told any of this. But others reading
this thread, whether now or in the archives...well, some of them
probably don't either. But some of them likely do.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse at
rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B