Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: How to use a struct with qsort()? Date: Thu, 24 Oct 2019 11:00:28 -0700 Organization: None to speak of Lines: 38 Message-ID: References: <06add10e-1e30-4741-a20c-ff56363733fe@googlegroups.com> <865zkfhbn8.fsf@linuxsc.com> <4w_rF.736155$CO2.65319@fx30.am4> <5b4sF.1834564$HWr.1450852@fx36.am4> <%66sF.406317$3C5.184897@fx01.am4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="e096da6c00dbbe41006bc53171a20aff"; logging-data="23964"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+UjdZZ3/EkzOA57xjHVYV" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:59maWmbKM9swxlghbXDWucInSLA= sha1:Hc+VP5KSDwS+cUe96g93DcIjgeE= Xref: csiph.com comp.lang.c:147203 Bart writes: > On 24/10/2019 02:20, Keith Thompson wrote: >> Bart writes: > >>> Really? You see 'struct T T' and you should instantly see the problem. >> >> I see two problems. One is the use of the non-descriptive name "T", >> which we've thoroughly covered. > > Yes. It is totally irrelevant, and is chosen to highlight the actual > point that exactly the same identifier can be used for very different > purposes. I still fail to understand why you mentioned it in the first > place. I fail to understand why we're still talking about it. We've been agreeing on this point for the last several followups. >> The other is the use of the same identifier as a tag and as an object >> name. >> >> You make the point that using a struct tag makes it possible to >> use the same identifier for a struct tag and for an object of the >> struct type. I agree (though I don't agree that it's a big deal, >> since it can easily be avoided by picking sensible names). > > You wouldn't. A beginner might, since there is nothing that stops it. > >> Did you have another point? > > Did you have another pointless objection? If you're not going to answer straightforward questions, this discussion is over. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */