Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: Text editor project in C Date: Tue, 27 Apr 2021 13:33:08 -0700 Organization: None to speak of Lines: 40 Message-ID: <87wnsna2nv.fsf@nosuchdomain.example.com> References: <877dkohi65.fsf@bsb.me.uk> <1bv9871zql.fsf@pfeifferfamily.net> <1bo8dz1xbq.fsf@pfeifferfamily.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="a57ae5a4f402968e927cf79882d3975a"; logging-data="9837"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6OHcMBDNsInjQ+0qN0Nit" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:4S8AX94OzzdXYl0IXsn5vfBuR+g= sha1:nGcB160k7tpxtk0QWvH7ChdnTe0= Xref: csiph.com comp.lang.c++:79340 comp.lang.c:160413 Lew Pitcher writes: > On Tue, 27 Apr 2021 10:55:37 -0600, Joe Pfeiffer wrote: >> scott@slp53.sl.home (Scott Lurndal) writes: >>> Joe Pfeiffer writes: >>>>Juha Nieminen writes: >>>>> However, the undetermined size of basic types (especially before >>>>> standardization) makes it more likely for C programs, especially ones >>>>> written back then, to be non-portable. Sure, even back when K&R first >>>>> "soft-standardized" the C language you shouldn't have assumed a certain >>>>> size for any basic type. >>>> >>>>Everybody "knew" longs were 32 bits, shorts and ints were both 16 bits, >>>>chars were 8 bits and we coded under that assumption. Lots and lots of >>>>code broke when we moved from 16 bit to 32 bit machines and the size of >>>>an int changed as a result. >>>> >>> >>> And, unfortunately, the types often were not abstracted behind >>> a typedef. The process identifer, group identifier and user >>> identifers were all 16-bit as well. This made for a painful >>> conversion to 32-bit PID/GID/UID in SVR4 (accompanied by abstract >>> types pid_t, gid_t, uid_t which, when used correctly, mean that >>> applications only needed a simple recompile to handle a change in width). >> >> There were no typedefs back then (at least I don't remember them that >> far back, and they don't appear in either Ritchie's reference manual nor >> Kernighan's tutorial). > > FWIW, my copy of K&R (Copyright 1978) has a whole section (Chapter 6.9) on typedefs > The "C Programming Language - Reference Manual" (by Dennis M. Richie) published as > Appendix A of that edition of K&R also includes a section (8.8 Typedef) on typedef, > along with the BNF for it in section 18.2 ("Declarations"). https://www.bell-labs.com/usr/dmr/www/cman.pdf (1975) doesn't mention typedef. K&R1 (1978) does. That's as far as I've been able to narrow it down. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */