Groups | Search | Server Info | Login | Register
Groups > comp.os.linux.misc > #69891
| Subject | Re: VMS |
|---|---|
| Newsgroups | comp.os.linux.misc |
| References | (12 earlier) <105iv97$3cuhr$3@dont-email.me> <105j3at$3dnfc$7@dont-email.me> <105j4nq$3dg6e$1@dont-email.me> <dPKcnTnUGs5hlR71nZ2dnZfqn_WdnZ2d@giganews.com> <wwvwm7wzpew.fsf@LkoBDZeT.terraraq.uk> |
| From | c186282 <c186282@nnada.net> |
| Date | 2025-07-25 04:39 -0400 |
| Message-ID | <CFadnUmUgtpy3x71nZ2dnZfqnPWdnZ2d@giganews.com> (permalink) |
On 7/25/25 3:43 AM, Richard Kettlewell wrote: > c186282 <c186282@nnada.net> writes: >> On 7/20/25 12:15 PM, Lew Pitcher wrote: >>> On Sun, 20 Jul 2025 16:51:57 +0100, The Natural Philosopher wrote: >>>> On 20/07/2025 15:42, Rich wrote: >>>>> In todays world, for all but the most esoteric (embedded and/or >>>>> FPGA) assuming char is exactly 8 bits is right often enough that no >>>>> one notices. But multiplying by sizeof(char) does avoid it >>>>> becoming an issue later on any unusual setups. >>>> >>>> That's what I like. Absolutely emphasises the point to the next >>>> programmer even if the compiler doesn't need to know >>> That's an awfully big leap for the next programmer to make, going >>> from "I wonder why he multiplies this value by 1" to "Oho!! That >>> MUST mean that CHAR_BIT is not 8!" >> >> Try including a clear/concise COMMENT after most every >> line in your code - a sort of narration of what/why. >> >> Almost every function I write has a 10-20 line comment >> at the top explaining what/why/how as well. >> >> Do that and 'future programmers' should Get It. >> If they don't then they shouldn't be programmers. >> >> Bytes/words/etc are NOT always multiples of 8 even now. DSP >> processors often use 24 bit words, has to do with, the common three >> 8-bit input channels. If you get a job maintaining 'legacy' systems >> then you should NEVER assume 4/8/16/32/64. > > Agreed. A concrete example is > https://downloads.ti.com/docs/esd/SPRU514/data-types-stdz0555922.html > where char is a 16-bit type. This links back to the nonsensical earlier > claim that multiplying by sizeof(char) would somehow ‘avoid it becoming > an issue’ because as that page notes, sizeof(char) remains equal to 1 on > that platform (as it has to). I started on a PDP-11 ... with that new 'C' language and lots of punch-cards ....... More fun than FORTRAN and COBOL ...... However the PDP-11 was a relatively NEW computer. The old mainframes were still The Standard. They are STILL standard, embedded deep in corporate/govt systems. They DID tend to use odd word/char sizes. You must never ASSUME 4/8/16/32 ... The Future ... who knows ?
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar
Re: VMS Rich <rich@example.invalid> - 2025-07-20 14:42 +0000
Re: VMS Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2025-07-20 14:54 +0000
Re: VMS The Natural Philosopher <tnp@invalid.invalid> - 2025-07-20 16:51 +0100
Re: VMS Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2025-07-20 16:15 +0000
Re: VMS c186282 <c186282@nnada.net> - 2025-07-25 00:31 -0400
Re: VMS rbowman <bowman@montana.com> - 2025-07-25 05:53 +0000
Re: VMS c186282 <c186282@nnada.net> - 2025-07-25 05:05 -0400
Re: VMS The Natural Philosopher <tnp@invalid.invalid> - 2025-07-25 10:59 +0100
Re: VMS candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-07-25 16:20 +0000
Re: VMS Richard Kettlewell <invalid@invalid.invalid> - 2025-07-25 08:43 +0100
Re: VMS c186282 <c186282@nnada.net> - 2025-07-25 04:39 -0400
Re: VMS Richard Kettlewell <invalid@invalid.invalid> - 2025-07-20 21:18 +0100
csiph-web