News for hackers. Stuff that matters.
Re:Computer Scientists’ Trivia by John23832 on Thursday February 02, 2017 @11:56AM (#13552020)
> In the C standard ‘byte’ means minimum addressable unit — the unit of sizeof

Do you have a reference? I've always seen a byte defined as 8 bits. No matter what. (Unless you're talking to a hard drive manufacturer, that's a different bucket of worms though.)

Re:Computer Scientists’ Trivia by Someone on Thursday February 02, 2017 @12:35PM (#13552446)
The draft ISO/IEC 9899:201x PDF of "Programming Languages — C" says:

"3.5 bit

unit of data storage in the execution environment large enough to hold an object that may have one of two values

NOTE It need not be possible to express the address of each individual bit of an object.

3.6 byte

addressable unit of data storage large enough to hold any member of the basic character set of the execution environment

NOTE 1 It is possible to express the address of each individual byte of an object uniquely.

NOTE 2 A byte is composed of a contiguous sequence of bits, the number of which is implementation-defined. The least significant bit is called the low-order bit; the most significant bit is called the high-order bit."

I can't find any indication that a byte is the minimum addressable unit. I guess that is because of 4-bit CPUs and/or CPUs that can address individual bits.

It also uses "byte" very sparingly, most of the time in the context of multibyte (not hyphenated) to single-byte (hyphenated) conversions, but also in section 5.2.1:

"The representation of each member of the source and execution basic character sets shall fit in a byte."

And there also is a guarantee that a unsigned char is as large as a byte in a footnote to section 6.2.6.1:

"A byte contains CHAR_BIT bits, and the values of type unsigned char range from 0 to 2^CHAR_BIT − 1"

I doubt that char and unsinged char can be of different size, but didn't check that.

Re:Computer Scientists’ Trivia by kps on Thursday February 02, 2017 @12:25PM (#13552327)
Orginally? See §7.4 of Planning a Computer System: Project Stretch, edited by Werner Buchholz who coined the term. http://archive.computerhistory.org/resources/text/IBM/Stretc...

For C, see C11 §3.6: “byte — addressable unit of data storage large enough to hold any member of the basic character set of the execution environment” http://www.iso-9899.info/n1570.html#3.6

Re:Computer Scientists’ Trivia by John23832 on Thursday February 02, 2017 @12:33PM (#13552421)
Makes sense now. Thanks
Re:Computer Scientists’ Trivia by jwilk on Thursday February 02, 2017 @12:27PM (#13552351)
(From the C99 standard:)

§ 6.5.3.4 The sizeof operator

[…]

Semantics

2 The sizeof operator yields the size (in bytes) of its operand,

[…]

3 When applied to an operand that has type char, unsigned char, or signed char, (or a qualified version thereof) the result is 1.