Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!dalcs!dalegass From: dalegass@dalcs.UUCP Newsgroups: comp.lang.c,comp.bugs.4bsd Subject: Re: Bad Pointer Declaration in 'scandir' Message-ID: <2514@dalcs.UUCP> Date: Tue, 7-Apr-87 08:28:53 EST Article-I.D.: dalcs.2514 Posted: Tue Apr 7 08:28:53 1987 Date-Received: Thu, 9-Apr-87 03:58:10 EST References: <2479@dalcs.UUCP> <5916@mimsy.UUCP> <2491@dalcs.UUCP> <6145@mimsy.UUCP> Organization: Dept. of Math., Stats & C.S., Dalhousie University, Halifax, N.S., Canada Lines: 49 Xref: utgpu comp.lang.c:1498 comp.bugs.4bsd:277 Summary: Gotta keep arguing... ******somebody please tell me what a line-eater is***** If this argument is totally irrelevant and it's bothering people, just let me know, and I'll acquiesce... In article <6145@mimsy.UUCP>, chris@mimsy.UUCP writes: > >In particular, the claim that *(*foo)[], which is a pointer to an array > >of pointers, should be replaced by ***foo, which is a pointer to a > >pointer (or an array of pointers) to a pointer (or an array of pointers) > >is WRONG, WRONG, WRONG! > > I did not (or I hope I did not) make such a claim. Rather, my > claim was that the type of `namelist' in scandir should have been > (struct direct ***): not (struct direct **[]), as it was in the > source and manual page; nor (struct direct *(*)[]), as was suggested > in the first article with this title. > But you did make such a claim: >>According to my understanding, this should be interpreted as an array >>of pointers to pointers to the direct structure.... I believe [it should >>read] struct direct *(*namelist)[]; > >No: for there is no such thing. A declaration for a pointer to an >array must specify the size of the array. In fact, what both the >code and the manual *should* say is > > struct direct ***namelist; Anyhow, I can't agree that ***namelist is more appropriate than *(*namelist)[] since the structure actuallly *is* a pointer to an array of pointers to... A pointer to a pointer to a pointer is what the thing is actually treated like, but a pointer to an array of pointers to.... seems to be a much better (and more readable) style.... ;-) *************************************************************************** Dale Gass, Dalhousie U., Halifax, N.S., Canada UUCP: {seismo|watmath|utai|garfield}!dalcs!dalegass.UUCP or dalegass@dalcs.UUCP ...!dalcs!dalcsug!dalegass.UUCP or dalegass@dalcsug.UUCP CDN: dalegass@cs.dal.cdn CSNET: dalegass%cs.dal.cdn@ubc.csnet ARPA: dalegass%cs.dal.cdn%ubc.csnet@CSNET-RELAY.ARPA