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, 16:37:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vt647a$u6co$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 15:00, David Brown wrote:
On 09/04/2025 15:13, bart wrote:
On 09/04/2025 13:36, David Brown wrote:
On 09/04/2025 12:51, bart wrote:
 
I'll have to think about this before replying to any other points.
>
Marvellous - I'd appreciate you putting more thought into this, and less knee-jerk reactions and exaggerations.  Please also read the relevant parts of the standards before replying - at the very least, section 6.2.7p1 and section 6.2.2.  Once you have read these and tried to understand them, it will be a lot easier to clear up any remaining issues.
>
I'm not going to wade through reams of Standard minutiae, sorry.
 Again, no one is suggesting that you read the entire C standard.  After all, that would clearly be an absurd idea for someone who spends such a lot of his time arguing about the C language and who even claims to have made a C compiler.
 I have given you clear references to two small parts of the standard. It really is not a lot of effort.
 
>
Are T and U compatible types are not? The answer must be unequivocal without needing to be a 'standards-head'.
 I have told you several times, for different variations of that "T" and "U" mean.
 Since you don't believe my explanations, and won't read the standards, I'm not sure how much more help I can be.
 
This has been said in this thread:
>
>
BC: The types involved are somewhat different, but are compatible enough
     for it to work. [In that the member types, offsets and overall size,
     since pass-by-value is used, correspond]
>
DB: The two types are entirely compatible.
>
BC: Are they?
>
TR: No, they are not.
>
You say they're compatible, Tim Rentsch says they're not; who's right?
>
 You have moved the goalposts around
Not really me.

so often that it is hard to keep track.  But Tim is correct - the names, when given, have to match as well as the types of the fields (but a typedef alias giving a different name to the same type is fine).
So who's right, you or Tim? Since you are saying contrary things.

>
The original point I'd been making was that, in C, there is no dedicated mechansism for sharing user-defined named entities like types, across modules.
 There /is/ a dedicated mechanism - described in 6.2.7p1.
According to that, then the 'Point' and 'vector' types in my original two-file example are not compatible, since they have different struct tags, plus they have different member names. But above you say they are 'entirely compatible'.
Maybe it's /you/ who needs brush up on the Standard! I merely said they are compatible enough to my program to work, since at the machine level, this is merely two consecutive f32 types.
BTW1 that paragraph doesn't say anything what 'pack()' setting is in force; that /has/ to be the same if otherwise different amounts of padding exist.
BTW2 that doesn't really say anything about how to share named non-linkage entities across translation units.

I notice you ignored the example in my language, many posts back, which makes it impossible to make such a mistake.
 Yes, I ignore your examples in your language - they have no bearing or relevance to anyone except you.
You're welcome to post the same example in a more mainstream language. However most still seem to based around independent compilation. Many still require two parts to each shared resource: a definition, and a separate interface, with some mechanism needed to keep them in sync.
My scheme only needs a definition for resources forming part of the same program. It also works for ALL named entities, not just those with 'linkage'.

  We all know there are other ways for a language to implement inter-unit sharing of information.  We all know that some of these can reduce the risk of certain errors.  We all know that you have to follow a simple rule in order to negate that risk in C - put shared types in shared headers.
If there was a 1:1 correspondence between a .c file and its .h, that would be great, but that rarely happens. In the LIBJPEG project for example, there are 76 .c files, and 12 .h files (but at least they are in the same folder).
There are still risks: suppose a project uses include files in multiple locations made known to the compiler. It will follow an implementation-defined algorithm to search multiple paths for an include file. But if one accidentally gets deleted or renamed, if may pick up up an identically named file elsewhere. They may be similar enough to allow compilation to proceed, but now it is buggy.

  No language negates all risks of errors - whatever language you use, you follow practices that balance the risk of errors with the convenience or flexibility that you want in the code.
The point is that C's scheme is 'ad hoc' with myriad (רבבה?) points of failure. You like to deny that. (Apparently if a compiler follows the same consistent set of rules, then it cannot be 'ad hoc'. But you can say this about any computer program; they are only following orders!)

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 Apr23:18 i  i    i  i i i     i i i+* Re: Endless complaints [was Re: do { quit; } else { }]14Janis Papanagnou
11 Apr00:10 i  i    i  i i i     i i ii`* Re: Endless complaints [was Re: do { quit; } else { }]13bart
11 Apr01:41 i  i    i  i i i     i i ii +- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
11 Apr03:45 i  i    i  i i i     i i ii +- Re: Endless complaints [was Re: do { quit; } else { }]1Kaz Kylheku
11 Apr09:14 i  i    i  i i i     i i ii `* Re: Endless complaints [was Re: do { quit; } else { }]10David Brown
11 Apr12:32 i  i    i  i i i     i i ii  `* Re: Endless complaints [was Re: do { quit; } else { }]9bart
11 Apr12:50 i  i    i  i i i     i i ii   +* Re: Endless complaints [was Re: do { quit; } else { }]5Michael S
11 Apr12:56 i  i    i  i i i     i i ii   i`* Re: Endless complaints [was Re: do { quit; } else { }]4bart
11 Apr13:12 i  i    i  i i i     i i ii   i `* Re: Endless complaints [was Re: do { quit; } else { }]3Michael S
11 Apr14:12 i  i    i  i i i     i i ii   i  +- Re: Endless complaints [was Re: do { quit; } else { }]1Janis Papanagnou
11 Apr15:55 i  i    i  i i i     i i ii   i  `- Re: Endless complaints [was Re: do { quit; } else { }]1bart
11 Apr14:02 i  i    i  i i i     i i ii   +- Re: Endless complaints [was Re: do { quit; } else { }]1David Brown
11 Apr18:03 i  i    i  i i i     i i ii   +- Re: Endless complaints1Tim Rentsch
11 Apr20:26 i  i    i  i i i     i i ii   `- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
10 Apr23:27 i  i    i  i i i     i i i`- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
10 Apr23:23 i  i    i  i i i     i i `* Re: do { quit; } else { }10Keith Thompson
11 Apr00:49 i  i    i  i i i     i i  `* Re: do { quit; } else { }9bart
11 Apr01:59 i  i    i  i i i     i i   `* Re: do { quit; } else { }8Keith Thompson
11 Apr12:26 i  i    i  i i i     i i    `* Re: do { quit; } else { }7Michael S
11 Apr15:11 i  i    i  i i i     i i     +- Re: do { quit; } else { }1David Brown
11 Apr18:22 i  i    i  i i i     i i     +* Re: do { quit; } else { }4Kaz Kylheku
11 Apr20:46 i  i    i  i i i     i i     i+* Re: do { quit; } else { }2bart
11 Apr22:10 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 Apr19:20 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 Apr00:02 i  i    i  i i i     i  ii`- Re: do { quit; } else { }1bart
11 Apr02:52 i  i    i  i i i     i  i+* Re: do { quit; } else { }5Tim Rentsch
11 Apr04:51 i  i    i  i i i     i  ii`* Re: do { quit; } else { }4Keith Thompson
11 Apr06:55 i  i    i  i i i     i  ii `* Re: do { quit; } else { }3Tim Rentsch
11 Apr07:00 i  i    i  i i i     i  ii  `* Re: do { quit; } else { }2Keith Thompson
11 Apr12:14 i  i    i  i i i     i  ii   `- Re: do { quit; } else { }1bart
11 Apr05:20 i  i    i  i i i     i  i+- Re: do { quit; } else { }1Keith Thompson
11 Apr05:24 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 Apr18:07 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 Apr17:27 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 Apr01:40 i  i    i  i  i  `* Re: do { quit; } else { }2James Kuyper
11 Apr17:20 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