• Re: do { quit; } else { }

    From Tim Rentsch@3:633/280.2 to All on Mon May 12 12:05:41 2025
    Michael S <already5chosen@yahoo.com> writes:

    On Fri, 11 Apr 2025 17:22:37 -0000 (UTC)
    Kaz Kylheku <643-408-1753@kylheku.com> wrote:

    On 2025-04-11, Michael S <already5chosen@yahoo.com> wrote:

    On Thu, 10 Apr 2025 17:59:15 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    An understanding of what "compatible types" means.

    Bart didn't say that types are compatible or non-compatible.
    He said that they are 'compatible enough'. That is not terminology
    of C Standard, but terminology of his own. And he seems to
    understand it.

    In my own translation, 'compatible enough' means that when these
    structs are accessed then any sane or even semi-sane compiler will
    generate code that will have the same effect as in case of access
    through structures with literally identical declarations.

    so struct { long x; } and struct { int x; } are compatible enough,
    in situations that are portable enough.

    I wish they would be, but according to C Standard they are not,
    ene when both represent 32-bt signed integer. That's because of
    misfeature called 'strong aliasing rules'.
    IMO, C would become better without this misfeature.

    I think this reaction is rather shortsighted. Making this change
    would incur several downsides, and offers no significant upside
    that I can see.

    First it would greatly complicate the language semantics.
    Whether a program is meaningful, and if so what the meaning is,
    would be much harder to state than it is now.

    Second it would imply that whether a program is well-defined is a
    lot more dependent on implementation-specific choices than it is
    now.

    Third, as a consequence of that, it would be harder to write
    program verification tools, because they would need to take these
    more extensive implementation dependencies into consideration.

    Fourth, there would be consequences for program optimization, and
    it is hard to dismiss those. Some people may not care about the
    optimizations losses, but certainly many people want the benefits
    of those optimizations.

    Fifth, related to the previous point, as a practical matter it would
    make getting the optimization benefits back again be nearly
    impossible. As things are now, it's easy to have a compiler option
    to disable the consequences of strong typing rules, and the result
    can still be a conforming implementation. But if the C standard
    would prescribe the semantics of cross-type access, then any option
    to ignore the implications of that prescription would necessarily
    make using said option result in a non-conforming implementation.

    To say the last point another way, with things as they are now
    developers can choose whether they want to observe the cross-type
    access restrictions, or ignore them, and still get a C compiler.
    If the effective type rules were discarded, there is no way to
    choose the more-optimizing path without getting something that
    is not a C compiler.

    Given that you can always get what you want either by choosing
    an appropriate compiler option (if available) or by using one of
    the well-known legal workarounds, I think it's hard to make a
    case that getting rid of the effective type restrictions is a
    good idea.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Mon May 12 18:30:05 2025
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    [...]

    Read what people write, not what you think they meant.

    This rule is a good one for other people too.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Mon May 12 19:35:25 2025
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    [...]

    Read what people write, not what you think they meant.

    This rule is a good one for other people too.

    Trivially true.

    If you have actually something to say to me, say it. Or don't.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Tue May 13 00:37:36 2025
    On 12/05/2025 04:05, Tim Rentsch wrote:
    Michael S <already5chosen@yahoo.com> writes:

    On Fri, 11 Apr 2025 17:22:37 -0000 (UTC)
    Kaz Kylheku <643-408-1753@kylheku.com> wrote:

    On 2025-04-11, Michael S <already5chosen@yahoo.com> wrote:

    On Thu, 10 Apr 2025 17:59:15 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    An understanding of what "compatible types" means.

    Bart didn't say that types are compatible or non-compatible.
    He said that they are 'compatible enough'. That is not terminology
    of C Standard, but terminology of his own. And he seems to
    understand it.

    In my own translation, 'compatible enough' means that when these
    structs are accessed then any sane or even semi-sane compiler will
    generate code that will have the same effect as in case of access
    through structures with literally identical declarations.

    so struct { long x; } and struct { int x; } are compatible enough,
    in situations that are portable enough.

    I wish they would be, but according to C Standard they are not,
    ene when both represent 32-bt signed integer. That's because of
    misfeature called 'strong aliasing rules'.
    IMO, C would become better without this misfeature.

    I am in two minds about this. I think there are good reasons for
    wanting compatibility between different integer types of the same size.
    But I prefer stronger separation between user-defined types - structs in C.

    In particular, I think it would be a big step backwards if independent
    struct types with the same fields were compatible - that would mean
    variables of those types could be assigned to each other, or used as parameters to functions, or pointers to those types could be intermixed.
    C does not make it convenient to have strong types, in comparison to
    many other languages - reducing the protections they give would make it
    far easier for coding errors to slip through.

    For plain integer types, however, I think the argument for making
    equal-sized types compatible is a lot stronger. Some compilers
    specifically say that they allow aliasing between such types (MSVC,
    according to what I have read, have said they never intend to support
    "strict aliasing" optimisations). Many software projects (such as
    Linux) use "-fno-strict-aliasing". And countless C programmers
    mistakenly believe that identically sized integer types are compatible
    (though I am not advocating for a weaker language simply because some
    users misunderstand the rules).


    I think this reaction is rather shortsighted. Making this change
    would incur several downsides, and offers no significant upside
    that I can see.

    First it would greatly complicate the language semantics.
    Whether a program is meaningful, and if so what the meaning is,
    would be much harder to state than it is now.

    The semantics I would recommend are extremely simple - arithmetic types
    which have identical sizes, values, and representations, should be
    compatible.

    As an alternative wording, I think it would be fine to leave the type compatibility rules as they are and make this change to the "effective
    type" rules in 6.5p7.


    Second it would imply that whether a program is well-defined is a
    lot more dependent on implementation-specific choices than it is
    now.

    It would make some programs that are currently incorrect, correct. And
    yes, it would mean that if code mixes up types and pointers, code may
    not then be portable - for example, code that passed the address of an
    "int" to a function requesting a "pointer to long" would compile on
    64-bit Windows and not on 64-bit Linux. But a lot of code is already non-portable, and I do not think this suggestion would make the
    situation significantly different.

    In particular, in situations where this change would allow code that previously had a constraint error, the code would now work as expected.
    The alternative solution currently used in many cases where the
    programmer knows that the type sizes are the same even though they are incompatible, is to use a cast - that will "keep the compiler happy" but
    will often not actually be well-defined behaviour. Making identically
    sized and represented integer types compatible would mean the compiler
    is already happy, and the code is well-defined.

    One place where it would help, however, is for code that uses fixed-size integer types. Whether "int32_t" is compatible with "int", "long", or
    other types, is already implementation-specific and the situation is
    often surprising to developers. It seems "obvious" that "int32_t" would
    be compatible with "int" on a 32-bit target - but on some targets, that
    is not the case.


    Third, as a consequence of that, it would be harder to write
    program verification tools, because they would need to take these
    more extensive implementation dependencies into consideration.

    I cannot see a basis for that. Compilers and other code analysis and verification tools can add whatever extra checks and controls they want.
    And I suspect it will be easier to check that code is correct
    according to the suggested updated rules than to spot some kinds of
    subtle mistakes using the existing rules.


    Fourth, there would be consequences for program optimization, and
    it is hard to dismiss those. Some people may not care about the optimizations losses, but certainly many people want the benefits
    of those optimizations.

    It is certainly the case that there are some optimisation opportunities
    due to the "strict aliasing" rules - the compiler knows that an "int *" pointer and a "long *" pointer do not point to the same data even if
    "int" and "long" are the same size on that platform. Analysis (I have
    read reports on this, but do not have references for them) of code
    generation by compilers with "strict aliasing" optimisation has,
    however, shown that it is rare that such optimisations make much
    difference - and often you would much better results from using
    "restrict". Also, with my suggested changes, compilers would retain the knowledge of no aliasing between integer types and floating point types,
    or between struct types.


    Fifth, related to the previous point, as a practical matter it would
    make getting the optimization benefits back again be nearly
    impossible. As things are now, it's easy to have a compiler option
    to disable the consequences of strong typing rules, and the result
    can still be a conforming implementation. But if the C standard
    would prescribe the semantics of cross-type access, then any option
    to ignore the implications of that prescription would necessarily
    make using said option result in a non-conforming implementation.


    Almost anyone interested in serious optimisation is already going to be
    using non-portable and compiler or target specific features. That
    objection is a complete non-issue.

    To say the last point another way, with things as they are now
    developers can choose whether they want to observe the cross-type
    access restrictions, or ignore them, and still get a C compiler.
    If the effective type rules were discarded, there is no way to
    choose the more-optimizing path without getting something that
    is not a C compiler.

    Given that you can always get what you want either by choosing
    an appropriate compiler option (if available) or by using one of
    the well-known legal workarounds, I think it's hard to make a
    case that getting rid of the effective type restrictions is a
    good idea.

    I have now made a case for a limited change to the aliasing rules
    (whether the change is made by type compatibility rules, constraints on assignment, or "effective type" rules). I did not think it was
    particularly hard to do so.

    Of course opinions will differ as to how good such arguments are, and
    any real changes would be based on far more serious thoughts and
    discussions.




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Tue May 13 04:44:29 2025
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

    On 09.05.2025 17:26, Richard Heathfield wrote:

    On 09/05/2025 16:04, Bonita Montero wrote:

    Am 09.05.2025 um 17:01 schrieb Scott Lurndal:

    Bonita Montero <Bonita.Montero@gmail.com> writes:

    Am 06.04.2025 um 17:14 schrieb Tim Rentsch:

    My impression was that "defer", or something very much like
    it, is being considered for inclusion in a future C standard. ...

    With C++ you can have defer without extending the language.

    This, however is comp.lang.c.

    I'm just trying to make it clear that C lacks convenience
    and productivity on every level.

    Then use something convenient and productive. But please confine your
    discussions of your chosen alternative to
    comp.lang.your.chosen.alternative instead of dragging them into
    comp.lang.c, where we discuss C.

    [...]

    Since some folks feel comfortable in their "C" bubble I understand
    that these people might feel annoyed by such posts.

    But showing deficiencies (in "C") and providing counter-examples or alternatives from other languages [as done here] should be welcome.
    (IMO. YMMV, of course.) [...]

    But of course no one forces these annoyed people to read all posts; suggestions had already been given to just skip those inconvenient
    threads or subhreads.

    This comment sounds like hearing from a neighbor that I shouldn't
    mind if his dog shits on my lawn, because I can easily step over
    the shit. Except that here there is a notable difference, in
    that it isn't the dog but the dog's owner doing the shitting.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Tue May 13 06:25:30 2025
    David Brown <david.brown@hesbynett.no> writes:
    [...]
    For plain integer types, however, I think the argument for making
    equal-sized types compatible is a lot stronger. Some compilers
    specifically say that they allow aliasing between such types (MSVC,
    according to what I have read, have said they never intend to support
    "strict aliasing" optimisations). Many software projects (such as
    Linux) use "-fno-strict-aliasing". And countless C programmers
    mistakenly believe that identically sized integer types are compatible (though I am not advocating for a weaker language simply because some
    users misunderstand the rules).

    I think that a lot of C programmers misunderstand what "compatible
    types" means. Many seem to think that two types are compatible if
    they have the same representation and can be assigned without a cast.

    In fact type compatibility is a much stricter concept than that.
    Two types are compatible if they are *the same type*, and in a few
    other circumstances. For example, char, signed char, and unsigned
    char are all incompatible with each other, even though two of them
    are guaranteed to have the same representation.

    A good way to think about it is that pointers to two types can be
    assigned without a cast if and only if the two types are compatible.
    For example, int and long objects can be assigned to each other
    without a cast, but int* and long* objects cannot.

    And changing the language to make int and long conditionally
    compatible would (a) make it too easy to write code that's valid
    in one implementation but violates a constraint in another, and (b)
    would break existing code. For example, a generic selection cannot
    have two associations with compatible types. _Generic with "int:"
    and "long:" would become invalid for implementations that make int
    and long compatible.

    (I wouldn't mind seeing a new form of generic association that
    selects the *first* matching type, but that's another can of worms.)

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Tue May 13 19:40:58 2025
    On 12/05/2025 22:25, Keith Thompson wrote:
    David Brown <david.brown@hesbynett.no> writes:
    [...]
    For plain integer types, however, I think the argument for making
    equal-sized types compatible is a lot stronger. Some compilers
    specifically say that they allow aliasing between such types (MSVC,
    according to what I have read, have said they never intend to support
    "strict aliasing" optimisations). Many software projects (such as
    Linux) use "-fno-strict-aliasing". And countless C programmers
    mistakenly believe that identically sized integer types are compatible
    (though I am not advocating for a weaker language simply because some
    users misunderstand the rules).

    I think that a lot of C programmers misunderstand what "compatible
    types" means. Many seem to think that two types are compatible if
    they have the same representation and can be assigned without a cast.


    Yes. Basically, most C programmers are not particularly aware of the technical definitions of some of the terms in C standards where they
    differ from common usage. The word "compatible" in English means that
    the things in question can work together or fit together. Thus there
    are a number of ways to view types as "compatible" in C in normal
    English, but only one definition of "compatible type" as a specific term
    in the C standard. (This sort of thing is, I think, inevitable in a
    language standard unless you want to invent new terms without a normal language meaning - such as "lvalue".)


    In fact type compatibility is a much stricter concept than that.
    Two types are compatible if they are *the same type*, and in a few
    other circumstances. For example, char, signed char, and unsigned
    char are all incompatible with each other, even though two of them
    are guaranteed to have the same representation.

    A good way to think about it is that pointers to two types can be
    assigned without a cast if and only if the two types are compatible.
    For example, int and long objects can be assigned to each other
    without a cast, but int* and long* objects cannot.


    Yes. That is also a good way for people to check if types are
    compatible, if they want to use "try it on a compiler and see" as an aid.

    And changing the language to make int and long conditionally
    compatible would (a) make it too easy to write code that's valid
    in one implementation but violates a constraint in another, and (b)
    would break existing code.

    Speaking as someone who uses the fixed-size types often, and sees it in
    other code, there is already a lot of such code that is valid in one implementation or target and not on others, primarily because "int32_t"
    may be typedef'ed to "int" or "long", and "int64_t" may be "long" or
    "long long". But I can see that making "long" compatible to either
    "int" or "long long", according to implementation, might cause more issues.

    I think a better change to consider is not changing the rules of type compatibility, but slightly loosening the rules for what types of lvalue expressions can be used to access objects in 6.5p7. (It is possible
    this could be done by changing the "effective type" rules in 6.5p6, but
    that might be more complicated.) Basically, we retain the restriction
    that an int* and a long* (for 32-bit int and long) cannot be assigned to
    each other without a cast, but that an int* lvalue /can/ be used to
    access a long object, and vice versa. The same would apply to any pairs
    of scalar types that have identical values and representations. I
    believe that change would not break any existing code, but would
    certainly fix some existing broken code. And it would allow compilers
    to continue to use most "strict aliasing" optimisations.

    For example, a generic selection cannot
    have two associations with compatible types. _Generic with "int:"
    and "long:" would become invalid for implementations that make int
    and long compatible.


    While that is true, I suspect that _Generic is used so little in
    practice that few if any would notice it!

    (I wouldn't mind seeing a new form of generic association that
    selects the *first* matching type, but that's another can of worms.)


    If I were looking to improve _Generic, I'd want a way to add new types
    to an existing _Generic macro (for new overloads). This could easily by
    done if the preprocessor had a #redefine directive that let you give a
    new definition of a macro name while using the old definition when
    expanding the new macro. That would be a whole barrel of worms :-)


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Tue May 13 22:54:15 2025
    On 09.05.2025 19:09, David Brown wrote:
    On 09/05/2025 17:54, Janis Papanagnou wrote:
    [...]

    Comparisons between C and other languages can certainly be on-topic for
    a C group. And deficiencies of C are as topical as the language's good points.

    However, Bonita's post here - like almost all Bonita's posts in this
    group - are not helpful or topical, but merely trolls of "C++ is vastly better than C - look at this line noise to see what you can do in C++".

    Yes, I understand your dislike. And in this case it's specifically easy
    for folks who dislike specific persons or dislike what they say what
    they can or should do about that. (And below in your post you formulate
    some personal options one may take to not see those people or their contributions any more.)


    Consider this about Bonita's post :
    [ farraginous list snipped ]

    Sure. - But there was no need to analyze or list all that (for me at
    least); you may have noticed my statement (and read between the lines;
    if it's not obvious I may have formulated that better, I admit.)

    (Note: I'm not saying that the previous post's content is correct,
    just that it was obviously meant as an improvement, which could or
    not affect evolution of "C" if considered; a point for discussion
    [for those who think it's worth].)


    It is not at all surprising that people find Bonita's posts in
    comp.lang.c annoying, and would be happier if they were restricted to comp.lang.c++. Most people just ignore them, others use killfiles, and
    some people optimistically try to persuade Bonita not to write such
    posts. I'd be surprised if there was anyone who actually thought they
    were a positive contribution to the group.

    Sure. (I have also a [small] killfile where there's mostly people
    listed that show [occasionally or regularly] sociopathic behavior
    (that annoys me more than aberrant posts or errant content.)

    As a general principle, I agree with you that languages other than C can
    at times be relevant and interesting in this group - but in this
    specific case, I see no value in Bonita's post.

    Yes. But note that we're now mixing arguments on two or three levels;
    it started with topicality, continued with quality/appropriateness,
    and ended with, um.., "known types of people [beyond all hope]".

    I think with a good grain of serenity we could also spare us those
    longish threads. Let's individually pick and choose what we like.

    Janis


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Tue May 13 22:55:02 2025
    On 09.05.2025 18:26, Richard Heathfield wrote:
    On 09/05/2025 16:54, Janis Papanagnou wrote:
    <snip>


    Since some folks feel comfortable in their "C" bubble I understand
    that these people might feel annoyed by such posts.

    Each newsgroup has a topic. I subscribe to no fewer than ten newsgroups, because I am interested in those ten topics. If you are interested in
    C++, you can subscribe to comp.lang.c++ and chat about it all day long
    and nobody will bat an eyelid. I have no doubt that many comp.lang.c subscribers are also subscribed to comp.lang.c++. Why not join their
    number, and keep the salt in the salt pot and the pepper in the pepper pot?

    (You seem to have missed the point; see below.)


    But showing deficiencies (in "C") and providing counter-examples or
    alternatives from other languages [as done here] should be welcome.

    Why?

    Four important ways that C scores over other languages are:

    * Speed
    * Simplicity
    * Size
    * Portability

    The more you add, the more likely you are to slow it down, the more
    complex you make it, the bigger it gets, and the harder it is to port.

    See; now you're discussing (in a very principle way) why the other
    poster's suggestion makes no sense [to you]. - That was the point.

    (And you can always skip questions or suggestions or discussions
    you are not interested in.)

    Janis

    [...]



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Tue May 13 23:13:04 2025
    On 12.05.2025 20:44, Tim Rentsch wrote:
    [...]

    But of course no one forces these annoyed people to read all posts;
    suggestions had already been given to just skip those inconvenient
    threads or subhreads.

    This comment sounds like hearing from a neighbor that I shouldn't
    mind if his dog shits on my lawn, because I can easily step over
    the shit.

    This comparison says, unfortunately, a lot more about you than
    about anything else.

    Except that here there is a notable difference, in
    that it isn't the dog but the dog's owner doing the shitting.

    I see you're redirecting your [strawman] comparison to a personal
    defamation. - I know that other poster's posts, I have my opinion
    about the posts (and about him), but that comparison is beyond all
    decency.

    Janis

    PS (@David): With this example you may now better understand what
    I had meant about criteria for my killfile entries. Some people
    write non-topical contents, some write nonsense or are uninformed,
    and some show (to various degrees) sociapathic behavior. - That's
    the Internet.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Tue May 13 23:35:43 2025
    On 13/05/2025 13:55, Janis Papanagnou wrote:
    On 09.05.2025 18:26, Richard Heathfield wrote:
    On 09/05/2025 16:54, Janis Papanagnou wrote:
    <snip>


    Since some folks feel comfortable in their "C" bubble I understand
    that these people might feel annoyed by such posts.

    Each newsgroup has a topic. I subscribe to no fewer than ten newsgroups,
    because I am interested in those ten topics. If you are interested in
    C++, you can subscribe to comp.lang.c++ and chat about it all day long
    and nobody will bat an eyelid. I have no doubt that many comp.lang.c
    subscribers are also subscribed to comp.lang.c++. Why not join their
    number, and keep the salt in the salt pot and the pepper in the pepper pot?

    (You seem to have missed the point; see below.)

    I know what /my/ point is, and I assure you I haven't missed it.

    But showing deficiencies (in "C") and providing counter-examples or
    alternatives from other languages [as done here] should be welcome.

    Why?

    Four important ways that C scores over other languages are:

    * Speed
    * Simplicity
    * Size
    * Portability

    The more you add, the more likely you are to slow it down, the more
    complex you make it, the bigger it gets, and the harder it is to port.

    See; now you're discussing

    .....a discussion that has been done to death far too often over
    at least the last quarter-century.

    (in a very principle way) why the other
    poster's suggestion makes no sense [to you]. - That was the point.

    No. The point is that if you want C++, you know where to find it,
    and it isn't here.

    (And you can always skip questions or suggestions or discussions
    you are not interested in.)

    And if someone urinates in your beer, you can always spit it out,
    right?

    We have topics for a reason.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Tue May 13 23:36:03 2025
    On 13/05/2025 14:54, Janis Papanagnou wrote:
    On 09.05.2025 19:09, David Brown wrote:
    On 09/05/2025 17:54, Janis Papanagnou wrote:
    [...]

    Comparisons between C and other languages can certainly be on-topic for
    a C group. And deficiencies of C are as topical as the language's good
    points.

    However, Bonita's post here - like almost all Bonita's posts in this
    group - are not helpful or topical, but merely trolls of "C++ is vastly
    better than C - look at this line noise to see what you can do in C++".

    Yes, I understand your dislike. And in this case it's specifically easy
    for folks who dislike specific persons or dislike what they say what
    they can or should do about that. (And below in your post you formulate
    some personal options one may take to not see those people or their contributions any more.)


    Consider this about Bonita's post :
    [ farraginous list snipped ]

    Sure. - But there was no need to analyze or list all that (for me at
    least); you may have noticed my statement (and read between the lines;
    if it's not obvious I may have formulated that better, I admit.)

    I am trying to make it clear to you why your argument - that it is
    appropriate to talk in this newsgroup about C's failings, and that it
    can be appropriate in this newsgroup to compare to other languages -
    does not apply in this particular case. I am having difficulty
    understanding why you think Bonita's post was appropriate, or why you
    disliked Richard's response.

    I agree with your basic principles - for the most part, if one person
    does not like the posts of another person, they can ignore those posts
    either automatically (with killfiles, filters, etc.) or "manually".

    However, those of us who see this group as a resource, or a just a place
    to hang out and chat about C, have a responsibility to try to keep the
    group tidy. That means occasionally responding to inappropriate posts
    and asking the poster to be more considerate to the group.


    I think with a good grain of serenity we could also spare us those
    longish threads. Let's individually pick and choose what we like.


    No, let's not. Let's - at least occasionally - take some responsibility
    and not ignore inappropriate behaviour. I don't want to drag this out,
    or overreact - Bonita's posts are not /that/ bad. But be clear on this:
    it was not Richard's post berating Bonita that made a long thread branch
    about topicality, it was /your/ post complaining about his post.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Tue May 13 23:46:09 2025
    On 13/05/2025 14:13, Janis Papanagnou wrote:
    On 12.05.2025 20:44, Tim Rentsch wrote:
    [...]

    But of course no one forces these annoyed people to read all posts;
    suggestions had already been given to just skip those inconvenient
    threads or subhreads.

    This comment sounds like hearing from a neighbor that I shouldn't
    mind if his dog shits on my lawn, because I can easily step over
    the shit.

    This comparison says, unfortunately, a lot more about you than
    about anything else.

    On the contrary, it says a lot more about you who choose to put
    your own agenda above the group dynamic because other people's
    opinions don't matter to you.

    It was a while back now, but there was a time when I lobbied in
    this group for a slight relaxing of topicality rules - not by
    breaching those rules, but by inviting discussion, cavassing
    opinions, and collating them into a show of hands. By an
    overwhelming majority the group turned me down. I didn't tell
    them 'to hell with you, I'll discuss what I damn well want to,
    and if you don't like it, tough cheese'; I accepted the group's
    decision.

    There may well be some subscribers here who remember that
    discussion and might be prepared to corroborate the above.

    Nobody can stop you posting whatever the hell you like here...
    except you. So the question comes down to whether you are an
    adult with the capacity for self-control and the will to
    participate in a way that observes the customs of the people
    whose company you have sought, or whether you are just a spoiled
    teenager in an adult's body.

    The choice is entirely yours.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 14 00:07:06 2025
    On 13/05/2025 15:46, Richard Heathfield wrote:

    It was a while back now, but there was a time when I lobbied in this
    group for a slight relaxing of topicality rules - not by breaching those rules, but by inviting discussion, cavassing opinions, and collating
    them into a show of hands. By an overwhelming majority the group turned
    me down. I didn't tell them 'to hell with you, I'll discuss what I damn
    well want to, and if you don't like it, tough cheese'; I accepted the group's decision.

    There may well be some subscribers here who remember that discussion and might be prepared to corroborate the above.


    It rings a bell, if that's enough corroboration for you.

    Perhaps enough has been said by all parties in this little branch -
    anything more is likely to be repetitive, or more heated than we might
    like. I would hate for animosity in a thread branch about topicality to
    spill over into the topical threads. Let's reserve the fire and passion
    for discussing C :-)


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed May 14 07:05:51 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:
    [...]
    It was a while back now, but there was a time when I lobbied in this
    group for a slight relaxing of topicality rules - not by breaching
    those rules, but by inviting discussion, cavassing opinions, and
    collating them into a show of hands. By an overwhelming majority the
    group turned me down. I didn't tell them 'to hell with you, I'll
    discuss what I damn well want to, and if you don't like it, tough
    cheese'; I accepted the group's decision.

    There may well be some subscribers here who remember that discussion
    and might be prepared to corroborate the above.

    <raises hand>

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Wed May 14 10:17:05 2025
    On 5/13/25 05:40, David Brown wrote:
    On 12/05/2025 22:25, Keith Thompson wrote:
    ....
    I think that a lot of C programmers misunderstand what "compatible
    types" means. Many seem to think that two types are compatible if
    they have the same representation and can be assigned without a cast.


    Yes. Basically, most C programmers are not particularly aware of the technical definitions of some of the terms in C standards where they
    differ from common usage. The word "compatible" in English means that
    the things in question can work together or fit together.

    That's pretty much what it means in C. Two C types are compatible in C
    if the C standard *guarantees* that they can work together - that you
    can use the types interchangeably. The tricky part is the definition of
    which pairs of types the C standard makes those guarantees for.
    The key point is that the undefined behavior of code which treats
    incompatible types as if they were compatible could also be that they
    work together, too, depending upon the implementation.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed May 14 10:51:01 2025
    James Kuyper <jameskuyper@alumni.caltech.edu> writes:
    On 5/13/25 05:40, David Brown wrote:
    On 12/05/2025 22:25, Keith Thompson wrote:
    ...
    I think that a lot of C programmers misunderstand what "compatible
    types" means. Many seem to think that two types are compatible if
    they have the same representation and can be assigned without a cast.

    Yes. Basically, most C programmers are not particularly aware of the
    technical definitions of some of the terms in C standards where they
    differ from common usage. The word "compatible" in English means that
    the things in question can work together or fit together.

    That's pretty much what it means in C. Two C types are compatible in C
    if the C standard *guarantees* that they can work together - that you
    can use the types interchangeably. The tricky part is the definition of
    which pairs of types the C standard makes those guarantees for.
    The key point is that the undefined behavior of code which treats incompatible types as if they were compatible could also be that they
    work together, too, depending upon the implementation.

    I suggest that the phrase "work together" is too vague. It's
    perfectly reasonable to say that two types that can be assigned to
    each other without casts can "work together", and I might even call
    them "compatible" if the standard didn't already define the term.

    To a first approximation, two types are compatible if they're the
    same type. The standard's section on compatible types points to
    additional rules for some cases. IMHO the English word "compatible"
    suggests a much looser relationship, but we're stuck with the
    standard's terminology (and I'm not sure what would be better).

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Wed May 14 11:15:17 2025
    James Kuyper <jameskuyper@alumni.caltech.edu> writes:

    On 5/13/25 05:40, David Brown wrote:

    On 12/05/2025 22:25, Keith Thompson wrote:

    ...

    I think that a lot of C programmers misunderstand what "compatible
    types" means. Many seem to think that two types are compatible if
    they have the same representation and can be assigned without a cast.

    Yes. Basically, most C programmers are not particularly aware of the
    technical definitions of some of the terms in C standards where they
    differ from common usage. The word "compatible" in English means that
    the things in question can work together or fit together.

    That's pretty much what it means in C. Two C types are compatible
    in C if the C standard *guarantees* that they can work together -
    that you can use the types interchangeably. [...]

    This description isn't exactly right, because the relationship of
    being compatible is not an equivalence relation. It is possible
    that given types A, B, and C, A is compatible with B, and B is
    compatible with C, but A is not compatible with C.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Wed May 14 12:23:48 2025
    On 5/13/25 20:51, Keith Thompson wrote:
    James Kuyper <jameskuyper@alumni.caltech.edu> writes:
    On 5/13/25 05:40, David Brown wrote:
    ....
    Yes. Basically, most C programmers are not particularly aware of the
    technical definitions of some of the terms in C standards where they
    differ from common usage. The word "compatible" in English means that
    the things in question can work together or fit together.

    That's pretty much what it means in C. Two C types are compatible in C
    if the C standard *guarantees* that they can work together - that you
    can use the types interchangeably. The tricky part is the definition of
    which pairs of types the C standard makes those guarantees for.
    The key point is that the undefined behavior of code which treats
    incompatible types as if they were compatible could also be that they
    work together, too, depending upon the implementation.

    I suggest that the phrase "work together" is too vague.

    I was trying to match the wording of the text I was responding to. What
    I meant can be made far more precise: the C standard guarantees that two compatible types will work together, in the sense that every case where
    the C standard mandates that two types must be compatible in order for something to work, it will work for them.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Wed May 14 12:34:11 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 09/05/2025 15:25, Bonita Montero wrote:

    Am 10.04.2025 um 00:07 schrieb Tim Rentsch:

    When someone is responding to a post, they are responding ONLY to
    the content in the posting they are responing to; not to some
    earlier posting in the same thread, not to a different posting
    submitted two weeks ago, not to what you meant to say but didn't,
    not to thoughts in your head but that you didn't say, but ONLY TO
    WHAT IS SAID IN THE POSTING BEING RESPONDED TO.

    If you can learn to follow this simple rule everyone in the
    newsgroup will be better off, including you.

    You're constantly overwhelmed by what people write here. Both in
    terms of content and the nature of the discussion. Don't try to
    constantly set rules; that seems petty.

    Tim's not setting a draconian rule in stone. He's presenting a
    perfectly sensible rule of thumb that is based on his decades of
    experience of posting to this group. Usenet works best when you snip
    the bits you're not replying to, and reply only within the context you
    have retained. Nearly all the leading experts in this group nearly
    always observe this rule of thumb, because it's simple common sense so
    to do.

    Note that my remarks did not direct anyone to do anything. The
    first paragraph gives an observation -- which I think agrees with
    the behavior of most posters in most cases -- about how responders
    actually act. The second paragraph gives a statement of opinion
    (or perhaps a prediction, depending on how the paragraph is
    interpreted) about what will happen if someone adopts the view
    explained in the first paragraph. There was no attempt to set
    rules.

    On what basis do you justify laying down your law for Tim to follow?

    I see no reason to care what Bonita Montero thinks. ISTM that the
    most common reaction among other responders is to say postings not
    topical to comp.lang.c should be posted elsewhere. So I don't
    think there is much danger of my reaction being in the minority.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 14 19:07:47 2025
    On 14/05/2025 04:23, James Kuyper wrote:
    On 5/13/25 20:51, Keith Thompson wrote:
    James Kuyper <jameskuyper@alumni.caltech.edu> writes:
    On 5/13/25 05:40, David Brown wrote:
    ...
    Yes. Basically, most C programmers are not particularly aware of the
    technical definitions of some of the terms in C standards where they
    differ from common usage. The word "compatible" in English means that
    the things in question can work together or fit together.

    That's pretty much what it means in C. Two C types are compatible in C
    if the C standard *guarantees* that they can work together - that you
    can use the types interchangeably. The tricky part is the definition of
    which pairs of types the C standard makes those guarantees for.
    The key point is that the undefined behavior of code which treats
    incompatible types as if they were compatible could also be that they
    work together, too, depending upon the implementation.

    I suggest that the phrase "work together" is too vague.

    I was trying to match the wording of the text I was responding to. What
    I meant can be made far more precise: the C standard guarantees that two compatible types will work together, in the sense that every case where
    the C standard mandates that two types must be compatible in order for something to work, it will work for them.


    That's a tautology - the C standard guarantees that two compatible types
    will work together in situations where the C standard requires that the
    types are compatible.

    I appreciate that it is difficult to give precise meanings to vague
    concepts, but I don't think that rephrasing helps!


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Wed May 14 19:19:33 2025
    On 13.05.2025 15:36, David Brown wrote:
    On 13/05/2025 14:54, Janis Papanagnou wrote:
    [...]

    I think with a good grain of serenity we could also spare us those
    longish threads. Let's individually pick and choose what we like.


    No, let's not. Let's - at least occasionally - take some responsibility
    and not ignore inappropriate behaviour. I don't want to drag this out,
    or overreact - Bonita's posts are not /that/ bad. But be clear on this:
    it was not Richard's post berating Bonita that made a long thread branch about topicality, it was /your/ post complaining about his post.

    Erm, no. I wasn't complaining, just giving a suggestion. That's
    something completely different in my book. A suggestion can be
    dismissed or be helpful. The posters decide.

    WRT who made the thread branch become long; every meta discussion
    contributes a bit, and it becomes long if we latch on posts and
    meta-topics - as we two currently seem to start. This was not my
    intention which merely was to suggest just a bit more serenity
    (and not discuss too deeply what's "appropriate or inappropriate
    behavior").

    Janis


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 14 19:22:35 2025
    On 14/05/2025 02:51, Keith Thompson wrote:
    James Kuyper <jameskuyper@alumni.caltech.edu> writes:
    On 5/13/25 05:40, David Brown wrote:
    On 12/05/2025 22:25, Keith Thompson wrote:
    ...
    I think that a lot of C programmers misunderstand what "compatible
    types" means. Many seem to think that two types are compatible if
    they have the same representation and can be assigned without a cast.

    Yes. Basically, most C programmers are not particularly aware of the
    technical definitions of some of the terms in C standards where they
    differ from common usage. The word "compatible" in English means that
    the things in question can work together or fit together.

    That's pretty much what it means in C. Two C types are compatible in C
    if the C standard *guarantees* that they can work together - that you
    can use the types interchangeably. The tricky part is the definition of
    which pairs of types the C standard makes those guarantees for.
    The key point is that the undefined behavior of code which treats
    incompatible types as if they were compatible could also be that they
    work together, too, depending upon the implementation.

    I suggest that the phrase "work together" is too vague. It's
    perfectly reasonable to say that two types that can be assigned to
    each other without casts can "work together", and I might even call
    them "compatible" if the standard didn't already define the term.


    Yes, exactly. If the C standard did not use the word "compatible", then programmers might consider two types to be "compatible" for a whole
    range of situations. That could include "can be assigned to each
    other", "can be assigned, possibly with casts", "can be converted back
    and forth to get back the original value", "can be mixed with each
    other's pointer types", "can be used to access each other", "can be used
    in the same code", and no doubt many others.

    So the term "compatible types" in C does not mean the same as it does in English, nor does it mean "types that work together" - precisely because
    those phrases in English are much vaguer and more general, and can mean different things to different people.

    To a first approximation, two types are compatible if they're the
    same type. The standard's section on compatible types points to
    additional rules for some cases. IMHO the English word "compatible"
    suggests a much looser relationship, but we're stuck with the
    standard's terminology (and I'm not sure what would be better).


    I think the solution for this kind of thing would be hyphenated terms - "pointer-compatible", "assignment-compatible", and the like. That
    would, IMHO, make it a clearer and there would be no risk of mixup
    between normal English language usage and technical terms. (For some technical terms, made-up works like "lvalue" are appropriate, but not in
    this case I think.)




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Wed May 14 19:22:56 2025
    On 13.05.2025 15:35, Richard Heathfield wrote:
    On 13/05/2025 13:55, Janis Papanagnou wrote:
    (And you can always skip questions or suggestions or discussions
    you are not interested in.)

    And if someone urinates in your beer, you can always spit it out, right?

    You seem to like (as Tim in another post) disgusting, inappropriate and misleading comparisons.

    Janis

    [...]


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Wed May 14 19:31:57 2025
    On 13.05.2025 15:46, Richard Heathfield wrote:
    On 13/05/2025 14:13, Janis Papanagnou wrote:
    On 12.05.2025 20:44, Tim Rentsch wrote:
    [...]

    But of course no one forces these annoyed people to read all posts;
    suggestions had already been given to just skip those inconvenient
    threads or subhreads.

    This comment sounds like hearing from a neighbor that I shouldn't
    mind if his dog shits on my lawn, because I can easily step over
    the shit.

    This comparison says, unfortunately, a lot more about you than
    about anything else.

    On the contrary, it says a lot more about you who choose to put your own agenda above the group dynamic because other people's opinions don't
    matter to you.

    I have no agenda, so I dismiss your imputation. I gave a suggestion on
    the raised attack against a poster that you may, as any suggestions,
    dismiss or consider. - The choice is entirely yours. (As you say below.)

    Janis

    [...]

    Nobody can stop you posting whatever the hell you like here... except
    you. So the question comes down to whether you are an adult with the
    capacity for self-control and the will to participate in a way that
    observes the customs of the people whose company you have sought, or
    whether you are just a spoiled teenager in an adult's body.

    The choice is entirely yours.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 14 19:34:52 2025
    On 14/05/2025 10:22, Janis Papanagnou wrote:
    On 13.05.2025 15:35, Richard Heathfield wrote:
    On 13/05/2025 13:55, Janis Papanagnou wrote:
    (And you can always skip questions or suggestions or discussions
    you are not interested in.)

    And if someone urinates in your beer, you can always spit it out, right?

    You seem to like (as Tim in another post) disgusting, inappropriate and misleading comparisons.

    I actually find them rather distasteful. The comparison is indeed
    disgusting, but it's apposite and not remotely misleading.

    I tried nice. You replied with scorn for the group.

    Now I've tried colourful, and you're still showing your contempt
    for the group.

    I should plonk you now, but because I'm inordinately patient I'll
    stay my hand for the third and last time.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 14 19:37:15 2025
    On 14/05/2025 10:31, Janis Papanagnou wrote:
    On 13.05.2025 15:46, Richard Heathfield wrote:
    On 13/05/2025 14:13, Janis Papanagnou wrote:
    On 12.05.2025 20:44, Tim Rentsch wrote:
    [...]

    But of course no one forces these annoyed people to read all posts;
    suggestions had already been given to just skip those inconvenient
    threads or subhreads.

    This comment sounds like hearing from a neighbor that I shouldn't
    mind if his dog shits on my lawn, because I can easily step over
    the shit.

    This comparison says, unfortunately, a lot more about you than
    about anything else.

    On the contrary, it says a lot more about you who choose to put your own
    agenda above the group dynamic because other people's opinions don't
    matter to you.

    I have no agenda

    Other than weakening the topicality mores in comp.lang.c, that is.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu May 15 01:03:12 2025
    On 2025-05-14, David Brown <david.brown@hesbynett.no> wrote:
    On 14/05/2025 04:23, James Kuyper wrote:
    On 5/13/25 20:51, Keith Thompson wrote:
    James Kuyper <jameskuyper@alumni.caltech.edu> writes:
    On 5/13/25 05:40, David Brown wrote:
    ...
    Yes. Basically, most C programmers are not particularly aware of the >>>>> technical definitions of some of the terms in C standards where they >>>>> differ from common usage. The word "compatible" in English means that >>>>> the things in question can work together or fit together.

    That's pretty much what it means in C. Two C types are compatible in C >>>> if the C standard *guarantees* that they can work together - that you
    can use the types interchangeably. The tricky part is the definition of >>>> which pairs of types the C standard makes those guarantees for.
    The key point is that the undefined behavior of code which treats
    incompatible types as if they were compatible could also be that they
    work together, too, depending upon the implementation.

    I suggest that the phrase "work together" is too vague.

    I was trying to match the wording of the text I was responding to. What
    I meant can be made far more precise: the C standard guarantees that two
    compatible types will work together, in the sense that every case where
    the C standard mandates that two types must be compatible in order for
    something to work, it will work for them.


    That's a tautology - the C standard guarantees that two compatible types will work together in situations where the C standard requires that the types are compatible.

    Moreover, signed and unsigned char work together, yet are incompatible.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Thu May 15 13:17:47 2025
    On 5/14/25 05:07, David Brown wrote:
    On 14/05/2025 04:23, James Kuyper wrote:
    ....
    I was trying to match the wording of the text I was responding to. What
    I meant can be made far more precise: the C standard guarantees that two
    compatible types will work together, in the sense that every case where
    the C standard mandates that two types must be compatible in order for
    something to work, it will work for them.


    That's a tautology - the C standard guarantees that two compatible
    types will work together in situations where the C standard requires
    that the types are compatible.

    It's not a tautology, it's a recipe for generating a much longer and
    more detailed specification by searching for relevant clauses from the
    standard and extracting the relevant words from those sections, which I
    had no particular desire to generate. My point was that it could be
    generated, and would, when generated constitute a definition of what
    "work together" means in this context.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)