From mboxrd@z Thu Jan 1 00:00:00 1970 From: imp@bsdimp.com (Warner Losh) Date: Thu, 11 May 2017 16:06:45 -0600 Subject: [TUHS] The evolution of Unix facilities and architecture In-Reply-To: References: <20170511140729.2262B18C09A@mercury.lcs.mit.edu> <20170511142142.GA4341@mcvoy.com> <20170511171100.GA9980@yeono.kjorling.se> Message-ID: On Thu, May 11, 2017 at 3:44 PM, Dave Horsfall wrote: > On Thu, 11 May 2017, Michael Kjörling wrote: > >> On the flip side, it certainly does beat `char* x, y, z[100];` or `FILE* >> fpsrc, fpdst;`. I wonder how many aspiring C programmers have been >> tripped up by constructs like those? It's perfectly reasonable _once you >> know about it_, but if you don't, then, well... > > Am I the only one here who thinks that e.g. a char pointer should be > "char* cp1, cp2" instead of "char *cp1, *cp2"? I.e. the fundamental type > is "char*", not "char", and to this day I still write: > > char* cp1; > char* cp2; > > etc, which IMHO makes it clear (which is every programmer's duty). I used > to write that way in a previous life, and the boss didn't complain. I've encountered several people with that world view, so you aren't alone. I take a contrary view. Since C doesn't behave that way, it encourages people to think that char* cp1, cp2 is equivalent to what you wrote, which it's not. * is a modifier of char rather than char * being a fundamental type. Been burned too many times by it I guess over the years. Warner