On 2017-10-12, Rhodri James <rho...@kynesim.co.uk> wrote: > On 12/10/17 16:06, Grant Edwards wrote: >> On 2017-10-12, Steve D'Aprano <steve+pyt...@pearwood.info> wrote: >>> On Thu, 12 Oct 2017 04:41 pm, Grant Edwards wrote: >>> >>>>> Even two different C compilers could return different values. >>>> >>>> Nope. If sizeof char is not 1, then it's not C. >>> >>> Today I Learned. >> >> It sure was an education the first I wrote C code for >> a machine where >> >> 1 == sizeof char == sizeof int == sizeof long == sizeof float == sizeof >> double >> >> All were 32 bits. > > Ah yes. In my case it was 16 bits, so sizeof long == 2 just for a > little variation.
It does help when a char is an integral number of octets. Working with a machine where everything is 20 bits would be even worse. I wonder if anybody ever designed a CPU where the word size was odd? -- Grant Edwards grant.b.edwards Yow! How many retured at bricklayers from FLORIDA gmail.com are out purchasing PENCIL SHARPENERS right NOW?? -- https://mail.python.org/mailman/listinfo/python-list