Re: do { quit; } else { }

Liste des GroupesRevenir à cl c 
Sujet : Re: do { quit; } else { }
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.c
Date : 09. Apr 2025, 01:02:29
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vt4del$3a9sk$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Mozilla Thunderbird
On 09/04/2025 00:27, Tim Rentsch wrote:
bart <bc@freeuk.com> writes:

If you want to make a point or ask a question about C code,
SHOW THE CODE.  And show all of it.  Don't make people guess
by showing only some of the code or by giving just a description.
>
I'm showing the code but you keep snipping it!  [...]
 No, I don't.  Don't be so obtuse.  I included the code I was
originally commenting on, in my first followup.  My comment about
showing code was about your second posting.  Let me repeat the two
important paragraphs (quoted above) taken from that posting:
 
I get an incompatible error (from the example you snipped) even when I
remove both struct tags.
 The phrase "even when I remove both struct tags" describes code, it
doesn't show the code.
I showed this example a few lines later which has both struct tags omitted:
BC:
 > Two typedefs for same struct layout appear to create distinct types;
 > this fails:
 >
 >    typedef struct {float x, y;} Point;
 >    typedef struct {float x, y;} vector;
 >
 >    Point p;
 >    vector v;
 >
 >    p=v;
But before I get there, I say:
 > I can't use the same struct tag in the same scope as one will clash with
 > the other.
That would be something like this:
     typedef struct tag {float x, y;} Point;
     typedef struct tag {float x, y;} vector;
I suggested:
 > But if I have the second in an inner scope, then I again get
 > the error.
That would be something like this where both 'struct tag' can co-exist:
     typedef struct tag {float x, y;} Point;
     {
        typedef struct tag {float x, y;} vector;
        ... rest of example that assigns v to p
     }
You asserted that the incompabilities are due to the struct tags. I tried various tests but couldn't find any evidence for that. The structs are incompatible, even though they have identical layout, member names and structs, because they distinct, as demonstrated by the first example in this post. (That needs to be inside any function to see that error.)
That makes sense to me, since different structs even with the same members could be intended for any number of unrelated purposes:
  typedef struct (float a, b, c;} rgbfloat;
  typedef struct (float a, b, c;} point;
  typedef struct (float a, b, c;} vector;
  typedef struct (float a, b, c;} circle;
  typedef struct (float a, b, c;} poly;
You wouldn't want instances to these to be assigned to each other willy-nilly, or passed to functions expectong one of the other functions.
Yes, you'd probably use better names, but AFAIK your choice of member names shouldn't play a part in determining compatibility.

Date Sujet#  Auteur
4 Apr 25 * do { quit; } else { }312Thiago Adams
4 Apr 25 +* Re: do { quit; } else { }2bart
4 Apr 25 i`- Re: do { quit; } else { }1Thiago Adams
4 Apr 25 +* Re: do { quit; } else { }11Kaz Kylheku
4 Apr 25 i+* Re: do { quit; } else { }3Thiago Adams
4 Apr 25 ii`* Re: do { quit; } else { }2Kaz Kylheku
4 Apr 25 ii `- Re: do { quit; } else { }1Chris M. Thomasson
4 Apr 25 i+* Re: do { quit; } else { }4Kaz Kylheku
4 Apr 25 ii+* Re: do { quit; } else { }2Thiago Adams
4 Apr 25 iii`- Re: do { quit; } else { }1Thiago Adams
8 Apr 25 ii`- Re: do { quit; } else { }1candycanearter07
5 Apr 25 i`* Re: do { quit; } else { }3Janis Papanagnou
5 Apr 25 i +- Re: do { quit; } else { }1Janis Papanagnou
6 Apr 25 i `- Re: do { quit; } else { }1Michael S
4 Apr 25 +* Re: do { quit; } else { }296Tim Rentsch
4 Apr 25 i`* Re: do { quit; } else { }295Thiago Adams
6 Apr 25 i `* Re: do { quit; } else { }294Tim Rentsch
6 Apr 25 i  +* Re: do { quit; } else { }276Michael S
6 Apr 25 i  i`* Re: do { quit; } else { }275Tim Rentsch
6 Apr 25 i  i `* Re: do { quit; } else { }274Michael S
7 Apr 25 i  i  `* Re: do { quit; } else { }273Tim Rentsch
7 Apr 25 i  i   `* Re: do { quit; } else { }272Michael S
7 Apr 25 i  i    +* Re: do { quit; } else { }268bart
8 Apr 25 i  i    i`* Re: do { quit; } else { }267David Brown
8 Apr 25 i  i    i `* Re: do { quit; } else { }266bart
8 Apr 25 i  i    i  +* Re: do { quit; } else { }261David Brown
8 Apr 25 i  i    i  i`* Re: do { quit; } else { }260bart
8 Apr 25 i  i    i  i +* Re: do { quit; } else { }58Tim Rentsch
8 Apr 25 i  i    i  i i`* Re: do { quit; } else { }57bart
8 Apr 25 i  i    i  i i +* Re: do { quit; } else { }54Tim Rentsch
8 Apr 25 i  i    i  i i i`* Re: do { quit; } else { }53bart
9 Apr 25 i  i    i  i i i `* Re: do { quit; } else { }52Tim Rentsch
9 Apr 25 i  i    i  i i i  `* Re: do { quit; } else { }51bart
9 Apr 25 i  i    i  i i i   +- Re: do { quit; } else { }1Chris M. Thomasson
9 Apr 25 i  i    i  i i i   +- Re: do { quit; } else { }1Chris M. Thomasson
9 Apr 25 i  i    i  i i i   `* Re: do { quit; } else { }48Tim Rentsch
10 Apr 25 i  i    i  i i i    `* Re: do { quit; } else { }47bart
10 Apr 25 i  i    i  i i i     +* Re: do { quit; } else { }45Kaz Kylheku
10 Apr 25 i  i    i  i i i     i+* Re: do { quit; } else { }2Michael S
10 Apr 25 i  i    i  i i i     ii`- Re: do { quit; } else { }1Kaz Kylheku
10 Apr 25 i  i    i  i i i     i`* Re: do { quit; } else { }42bart
10 Apr 25 i  i    i  i i i     i +* Re: do { quit; } else { }28Keith Thompson
10 Apr 25 i  i    i  i i i     i i`* Re: do { quit; } else { }27bart
10 Apr 25 i  i    i  i i i     i i +* Re: Endless complaints [was Re: do { quit; } else { }]16bart
10 Apr 25 i  i    i  i i i     i i i+* Re: Endless complaints [was Re: do { quit; } else { }]14Janis Papanagnou
11 Apr 25 i  i    i  i i i     i i ii`* Re: Endless complaints [was Re: do { quit; } else { }]13bart
11 Apr 25 i  i    i  i i i     i i ii +- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
11 Apr 25 i  i    i  i i i     i i ii +- Re: Endless complaints [was Re: do { quit; } else { }]1Kaz Kylheku
11 Apr 25 i  i    i  i i i     i i ii `* Re: Endless complaints [was Re: do { quit; } else { }]10David Brown
11 Apr 25 i  i    i  i i i     i i ii  `* Re: Endless complaints [was Re: do { quit; } else { }]9bart
11 Apr 25 i  i    i  i i i     i i ii   +* Re: Endless complaints [was Re: do { quit; } else { }]5Michael S
11 Apr 25 i  i    i  i i i     i i ii   i`* Re: Endless complaints [was Re: do { quit; } else { }]4bart
11 Apr 25 i  i    i  i i i     i i ii   i `* Re: Endless complaints [was Re: do { quit; } else { }]3Michael S
11 Apr 25 i  i    i  i i i     i i ii   i  +- Re: Endless complaints [was Re: do { quit; } else { }]1Janis Papanagnou
11 Apr 25 i  i    i  i i i     i i ii   i  `- Re: Endless complaints [was Re: do { quit; } else { }]1bart
11 Apr 25 i  i    i  i i i     i i ii   +- Re: Endless complaints [was Re: do { quit; } else { }]1David Brown
11 Apr 25 i  i    i  i i i     i i ii   +- Re: Endless complaints1Tim Rentsch
11 Apr 25 i  i    i  i i i     i i ii   `- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
10 Apr 25 i  i    i  i i i     i i i`- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
10 Apr 25 i  i    i  i i i     i i `* Re: do { quit; } else { }10Keith Thompson
11 Apr 25 i  i    i  i i i     i i  `* Re: do { quit; } else { }9bart
11 Apr 25 i  i    i  i i i     i i   `* Re: do { quit; } else { }8Keith Thompson
11 Apr 25 i  i    i  i i i     i i    `* Re: do { quit; } else { }7Michael S
11 Apr 25 i  i    i  i i i     i i     +- Re: do { quit; } else { }1David Brown
11 Apr 25 i  i    i  i i i     i i     +* Re: do { quit; } else { }4Kaz Kylheku
11 Apr 25 i  i    i  i i i     i i     i+* Re: do { quit; } else { }2bart
11 Apr 25 i  i    i  i i i     i i     ii`- Re: do { quit; } else { }1Keith Thompson
13 Apr18:45 i  i    i  i i i     i i     i`- Re: do { quit; } else { }1Michael S
11 Apr 25 i  i    i  i i i     i i     `- Re: do { quit; } else { }1Keith Thompson
10 Apr 25 i  i    i  i i i     i `* Re: do { quit; } else { }13Kaz Kylheku
10 Apr 25 i  i    i  i i i     i  +* Re: do { quit; } else { }10bart
10 Apr 25 i  i    i  i i i     i  i+* Re: do { quit; } else { }2Kaz Kylheku
11 Apr 25 i  i    i  i i i     i  ii`- Re: do { quit; } else { }1bart
11 Apr 25 i  i    i  i i i     i  i+* Re: do { quit; } else { }5Tim Rentsch
11 Apr 25 i  i    i  i i i     i  ii`* Re: do { quit; } else { }4Keith Thompson
11 Apr 25 i  i    i  i i i     i  ii `* Re: do { quit; } else { }3Tim Rentsch
11 Apr 25 i  i    i  i i i     i  ii  `* Re: do { quit; } else { }2Keith Thompson
11 Apr 25 i  i    i  i i i     i  ii   `- Re: do { quit; } else { }1bart
11 Apr 25 i  i    i  i i i     i  i+- Re: do { quit; } else { }1Keith Thompson
11 Apr 25 i  i    i  i i i     i  i`- Re: do { quit; } else { }1Keith Thompson
10 Apr 25 i  i    i  i i i     i  +- Re: do { quit; } else { }1bart
10 Apr 25 i  i    i  i i i     i  `- Re: do { quit; } else { }1Kaz Kylheku
11 Apr 25 i  i    i  i i i     `- Re: do { quit; } else { }1Tim Rentsch
9 Apr 25 i  i    i  i i +- Re: do { quit; } else { }1Richard Damon
9 Apr 25 i  i    i  i i `- Re: do { quit; } else { }1David Brown
9 Apr 25 i  i    i  i `* Re: do { quit; } else { }201David Brown
9 Apr 25 i  i    i  i  +* Re: do { quit; } else { }3Michael S
9 Apr 25 i  i    i  i  i+- Re: do { quit; } else { }1David Brown
11 Apr 25 i  i    i  i  i`- Re: do { quit; } else { }1James Kuyper
9 Apr 25 i  i    i  i  +* Re: do { quit; } else { }2Michael S
9 Apr 25 i  i    i  i  i`- Re: do { quit; } else { }1David Brown
9 Apr 25 i  i    i  i  +* Re: do { quit; } else { }2Michael S
9 Apr 25 i  i    i  i  i`- Re: do { quit; } else { }1David Brown
9 Apr 25 i  i    i  i  +* Re: do { quit; } else { }7bart
9 Apr 25 i  i    i  i  i`* Re: do { quit; } else { }6David Brown
9 Apr 25 i  i    i  i  i `* Re: do { quit; } else { }5bart
9 Apr 25 i  i    i  i  i  +* Re: do { quit; } else { }2David Brown
9 Apr 25 i  i    i  i  i  i`- Re: do { quit; } else { }1bart
11 Apr 25 i  i    i  i  i  `* Re: do { quit; } else { }2James Kuyper
11 Apr 25 i  i    i  i  i   `- Re: do { quit; } else { }1James Kuyper
9 Apr 25 i  i    i  i  `* Re: do { quit; } else { }186Janis Papanagnou
8 Apr 25 i  i    i  +- Re: do { quit; } else { }1Tim Rentsch
9 Apr 25 i  i    i  `* Re: do { quit; } else { }3Ike Naar
8 Apr 25 i  i    `* Re: do { quit; } else { }3Tim Rentsch
6 Apr 25 i  `* Re: do { quit; } else { }17Michael S
6 Apr 25 +- Re: do { quit; } else { }1Lawrence D'Oliveiro
6 Apr 25 `- Re: do { quit; } else { }1David Brown

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal