Deutsch English Français Italiano |
<20250410120831.00006684@yahoo.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: do { quit; } else { } Date: Thu, 10 Apr 2025 12:08:31 +0300 Organization: A noiseless patient Spider Lines: 71 Message-ID: <20250410120831.00006684@yahoo.com> References: <vspbjh$8dvd$1@dont-email.me> <8634enhcui.fsf@linuxsc.com> <vsph6b$ce6m$5@dont-email.me> <86ldsdfocs.fsf@linuxsc.com> <20250406161323.00005809@yahoo.com> <86ecy5fjin.fsf@linuxsc.com> <20250406190321.000001dc@yahoo.com> <86plhodtsw.fsf@linuxsc.com> <20250407210248.00006457@yahoo.com> <vt15lq$bjs0$3@dont-email.me> <vt2lp6$1qtjd$1@dont-email.me> <vt31m5$2513i$1@dont-email.me> <vt3d4g$2djqe$1@dont-email.me> <vt3iqh$2ka99$1@dont-email.me> <868qoaeezc.fsf@linuxsc.com> <vt3oeo$2oq3p$1@dont-email.me> <86mscqcpy1.fsf@linuxsc.com> <vt48go$35hh3$2@dont-email.me> <86iknecjz8.fsf@linuxsc.com> <vt4del$3a9sk$1@dont-email.me> <86o6x5at05.fsf@linuxsc.com> <vt712u$1m84p$1@dont-email.me> <20250409170901.947@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Thu, 10 Apr 2025 11:08:31 +0200 (CEST) Injection-Info: dont-email.me; posting-host="52a9426fb6be992bf0be892ea51bbb02"; logging-data="1016382"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/y0tT8mzbDbOpORBgYNwuKQYTglGLtf/0=" Cancel-Lock: sha1:K0Zjk1IJwbwpmtxVWylpBPt2d68= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 4197 On Thu, 10 Apr 2025 00:20:29 -0000 (UTC) Kaz Kylheku <643-408-1753@kylheku.com> wrote: > On 2025-04-09, bart <bc@freeuk.com> wrote: > > I'm not sure what your gripe is other than maybe I picked up on > > something you got wrong. The discussion was about two struct types > > like this: > > > > typedef struct tag1 {...} T1; > > typedef struct tag2 {...} T2; > > > > and whether T1 and T2 were compatible or not. You said: > > > > "and those types are not compatible, because the two struct tags > > are different." > > > > In this case the tags would be "tag1" and "tag2". I then said: > > > > "I get an incompatible error (from the example you snipped) even > > when I remove both struct tags." > > When you remove the tag from a struct definition, the implementation > behaves as if it were implementing a unique tag which is different > from any other such tag, and any tag that can possibly be written > using textual syntax. > > How did you implement tagless struct declarations in your compiler? > > > That means removing "tag1" and "tag2" so the example above looks > > like this: > > > > typedef struct {...} T1; > > typedef struct {...} T2; > > > > Here, you can't say the struct tags are different, as they are not > > visible! > > So if you close your eyes, two things that were different are now > no longer different, since they are invisible? > > The tag is a property of the type, not of printed type declaration. > > A struct type has a tag. If the declaration doesn't show one, > that doesn't mean it doesn't have a tag. > In the message above Bart demonstrated that type of struct with explicit tag depends not just on tag and fields, but also on lexical scope. IMHO, instead of going into irrelevant details, it is much simpler to postulate that all struct declarations within given translation unit have different types. Upthread, somebody said that already. May be, you. > If a "Simulation" object has a "gravity" member, do you conclude > that a given simulation has no gravity, because the constructor > omitted specifying it? > > Simulation s = new Simulation(windSpeed = 35.7) > I am not quite understand how C++ is relevant. > > As I concluded, your assertion about compatibility being based on > > tags being the same or not didn't seem right.) > > Or, you know, you could stop caring about what someone wrote in > comp.lang.c, be they right or wrong, and ... look it up? >