Date: Fri, 15 Jan 2021 20:22:01 +0100 From: Walter von Entferndt <walter.von.entferndt@posteo.net> To: Mark Millard <marklmi@yahoo.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Implicit assumptions (was: Re: Some fun with -O2) Message-ID: <8830694.EFs4ROYVHJ@t450s.local.lan> In-Reply-To: <FA82F286-8818-45B8-81C0-CE8A85BBB366@yahoo.com> References: <mailman.29.1610625600.45116.freebsd-hackers@freebsd.org> <2310709.D6tDg3Ca2R@t450s.local.lan> <FA82F286-8818-45B8-81C0-CE8A85BBB366@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
At Freitag, 15. Januar 2021, 19:35:40 CET Mark Millard wrote: > Have you read a (fairly modern) C standard or its officially > published rationle? You might want to. > Honestly, no. The price to download the official standard PDF from https:// www.iso.org/standard/74528.html is ~200 CHF. If you can send me a link to download a copy, I'd be thankful. Any other good reference manual either in PDF or HTML (tarball or thelike) would also be fine. I showed my source (https://code-reference.com/c/) which I quickly looked up on the net. > From the officially published C99 rationale (page labeled 11, > Terms and definitions): > > QUOTE > ) All objects in C must be representable as a contiguous sequence of bytes, > each of which is at least 8 bits wide. > > ) A char whether signed or unsigned, occupies exactly one byte. > That means it does not make any difference to use either NBBY or CHAR_BIT? Maybe CHAR_BIT is preferable, because it is C standard (guaranteed to exist on all platforms), whereas NBBY is not since it's in include/sys? Beside that, can you affirm the fix I suggested is correct & portable? -- =|o) "Stell' Dir vor es geht und keiner kriegt's hin." (Wolfgang Neuss)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8830694.EFs4ROYVHJ>