John Messenger said:
Yeah. Everything's already been invented, too, so there's no need to
worry about future implementations or architectures.
I should have qualified my response as saying that we *currently* do not
have to deal with padding bits in the real world. Not with gcc under
Linux, or MS VC++ in Windows, or with all of the embedded C compilers we
use (which mainly run under Windows).
Future implementations or architectures may well decide to include
padding bits in integer types, and if so, we'll have to deal with that
decision. In all likelihood, though, the next breakthrough in computer
architecture will be 128-bit integers, and they won't use any padding
bits.
The motivation for asking my question comes from having to deal with C
programmers who, unlike you and me and the other experts in this
newsgroup, don't know the least thing about padding bits in integer
types, and therefore don't know about how to deal with the ramifications
of implementing code that might be compromised by a compiler that defines
padding bits. If there are no compilers in the real world that use
padding bits in integer types, then my job of managing these people
becomes a lot easier.
And if you'd asked instead, say, whether anyone had used any non-ASCII
character sets, and it just happened that nobody who had done so
bothered to respond to your article, would you have concluded that
non-ASCII character sets do not now and will never exist?
Yes.
ASCII is the de facto standard for C code in general and source code
distribution in general. Any time one distributes source code via an
electronic medium (whether it is on a CD, or in a compressed archive such
as GZIP or ZIP or BZ or whatever, or in a simple uncompressed format,
etc.), they have committed to using a specific character encoding,
whether they are aware of it or like it or not.
You, and your companions, in fact, distribute the source code for the
examples in the book "C Unleashed" in ASCII encoding, right? By doing so,
you have conformed to the de facto use of ASCII character encoding, and
at the same time gave all of those no hope in using your source code if
they use a compiler that uses any character encoding other than ASCII.
Did you and the others who wrote "C Unleashed" include any type of
disclaimer similar to the following?
"The source code on the companion CD is stored in the ASCII encoding
format. If you use any C compiler that does not expect the ASCII encoding
format, this code will most likely not compile. Don't blame this on the C
Standard--blame it on us".
The only sure way to "distribute" portable C source code is via such
mediums as printed books or printed graphics (e.g., what you see on your
monitor when viewing web pages on The Internet, or when viewing posts on
Usenet, etc.). Although guaranteed to be portable, users would be overly
burdened by having to convert there graphics to source files (encoded in
their compiler's required format--ASCII, EBCDIC, etc.) using some
arguably amazing character recognition program.
Imagine if, for the sake of true portability, all currently distributed
open source distributions (mainly GZ or BZ2 file) were instead
distributed as character glyphs on a web page--and you were responsible
for converting these graphics to files in your compiler's expected
character encoding.
[snip]
Everything has been invented, all the world's a 32-bit PC running
Windows, and the world has an infinite supply of oil.
And all the world's 32-bit or 64-bit Linux. And food comes from the
supermarket. And water comes from the faucet.
Whether we like it or not, there are people in the real world who think
this way, and we have to deal with them. And if these people don't have
to worry about padding bits in integer types, then it makes our job a lot
easier when managing them. And, thankfully, these people will never work
on C code targeted for the Burroughs B7700.