• Re: Expression statements (was Re: Meaning of "expression")

    From Tim Rentsch@3:633/10 to All on Fri Aug 14 13:40:40 2026
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    [...]

    For example, this program:

    #include <stdio.h>
    int main(void) {
    const int result = printf("%ld\n", 0.3);
    printf("printf returned %d\n", result);
    }

    on my system prints:

    140732048673560
    printf returned 16

    gcc and clang warn about the format string. tcc doesn't.

    The (first) printf call was apparently successful because printf
    has no way to know that the argument was of an incorrect type
    (types don't really exist at run time).

    printf() could know if an argument were of an incorrect type, if
    an implementation chose to do so.

    Sure. I did write "on my system", where printf has no way to know
    that the argument was of an incorrect type.

    The "on my system" applies to what the program prints.

    The paragraph that says "printf has no way to know" is a general
    statement, for any implementation of printf(). If you had meant it
    to apply only to your system, you should have said something like
    "because that printf had no way to know". Without any qualifying
    adjective or other indicator the statement is generic, not
    specific.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Fri Aug 14 14:13:59 2026
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    [...]

    For example, this program:

    #include <stdio.h>
    int main(void) {
    const int result = printf("%ld\n", 0.3);
    printf("printf returned %d\n", result);
    }

    on my system prints:

    140732048673560
    printf returned 16

    gcc and clang warn about the format string. tcc doesn't.

    The (first) printf call was apparently successful because printf
    has no way to know that the argument was of an incorrect type
    (types don't really exist at run time).

    printf() could know if an argument were of an incorrect type, if
    an implementation chose to do so.

    Sure. I did write "on my system", where printf has no way to know
    that the argument was of an incorrect type.

    The "on my system" applies to what the program prints.

    The paragraph that says "printf has no way to know" is a general
    statement, for any implementation of printf(). If you had meant it
    to apply only to your system, you should have said something like
    "because that printf had no way to know". Without any qualifying
    adjective or other indicator the statement is generic, not
    specific.

    You're quibbling about something I wrote nearly two months ago.

    Certainly printf has no way defined by the language to know whether
    its arguments are of the correct types. An implementation could
    provide that information via some system-specific method, but I know
    of no implementations that do so, and I'd be surprised if any such implementations exist. What I wrote was true on my system and is
    very likely true on all real-world systems.

    If you have something to say about whether any such implementations
    exist, I invite you, but do not expect you, to share it. That might
    actually be interesting.

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

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Rentsch@3:633/10 to All on Wed Aug 19 08:32:09 2026
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    [...]

    For example, this program:

    #include <stdio.h>
    int main(void) {
    const int result = printf("%ld\n", 0.3);
    printf("printf returned %d\n", result);
    }

    on my system prints:

    140732048673560
    printf returned 16

    gcc and clang warn about the format string. tcc doesn't.

    The (first) printf call was apparently successful because printf
    has no way to know that the argument was of an incorrect type
    (types don't really exist at run time).

    printf() could know if an argument were of an incorrect type, if
    an implementation chose to do so.

    Sure. I did write "on my system", where printf has no way to know
    that the argument was of an incorrect type.

    The "on my system" applies to what the program prints.

    The paragraph that says "printf has no way to know" is a general
    statement, for any implementation of printf(). If you had meant it
    to apply only to your system, you should have said something like
    "because that printf had no way to know". Without any qualifying
    adjective or other indicator the statement is generic, not
    specific.

    [...] Certainly printf has no way defined by the language to know
    whether its arguments are of the correct types. An implementation
    could provide that information via some system-specific method,
    [...]

    I'm glad to know we are in agreement.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Wed Aug 19 15:09:31 2026
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    [...]
    I'm glad to know we are in agreement.

    We're not.

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

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Rentsch@3:633/10 to All on Sun Aug 23 06:18:13 2026
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    [...]

    I'm glad to know we are in agreement.

    We're not.

    I don't know why you say this. I said this:

    printf() could know if an argument were of an incorrect type,
    if an implementation chose to do so.

    You said this:

    Certainly printf has no way defined by the language to know
    whether its arguments are of the correct types. An
    implementation could provide that information via some
    system-specific method,

    To me that statement implies that an implementation could provide a
    printf() function that took advantage of the argument types you say
    an implementation could provide, and thus could know if an argument
    were of an incorrect type. What part of what you think I am saying
    do you not agree with?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Sun Aug 23 21:21:50 2026
    On 23/08/2026 9:18 PM, Tim Rentsch wrote:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    [...]

    I'm glad to know we are in agreement.

    We're not.

    I don't know why you say this. I said this:

    printf() could know if an argument were of an incorrect type,
    if an implementation chose to do so.

    You said this:

    Certainly printf has no way defined by the language to know
    whether its arguments are of the correct types. An
    implementation could provide that information via some
    system-specific method,

    To me that statement implies that an implementation could provide a
    printf() function that took advantage of the argument types you say
    an implementation could provide, and thus could know if an argument
    were of an incorrect type. What part of what you think I am saying
    do you not agree with?

    Dear Tim,

    I believe you are correct. If there is a disagreement, it's probable
    that Keith does not have enough reading comprehension. He is probably killfiling me, so you can do with this knowledge what you want.


    Best wishes, and happy C coding!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Sun Aug 23 15:36:48 2026
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    [...]

    I'm glad to know we are in agreement.

    We're not.

    I don't know why you say this.

    And I'm ok with that. Your reactions when I've asked you to clarify
    things in the past do not incline me to do the same for you.

    [...]

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

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Rentsch@3:633/10 to All on Thu Aug 27 10:04:32 2026
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    [...]

    I'm glad to know we are in agreement.

    We're not.

    I don't know why you say this.

    And I'm ok with that. Your reactions when I've asked you to clarify
    things in the past do not incline me to do the same for you.

    The difference here is that I didn't just ask a question, but
    gave a detailed explanation for my statement. So your response
    gives the impression of you simply not wanting to admit that
    you're wrong.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Thu Aug 27 20:42:03 2026
    In article <86fqzzxzof.fsf@linuxsc.com>,
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    [...]

    I'm glad to know we are in agreement.

    We're not.

    I don't know why you say this.

    And I'm ok with that. Your reactions when I've asked you
    to clarify
    things in the past do not incline me to do the same for you.

    The difference here is that I didn't just ask a question, but
    gave a detailed explanation for my statement.

    Your error here is that you seem to believe that Keith owes you
    some kind of response. In fact, he owes you nothing.

    So your response
    gives the impression of you simply not wanting to admit that
    you're wrong.

    That's rich. You make a number of incorrect statements that
    make clear that, frequently, you do not know what you are
    talking about. Yet despite your obvious ignorance on a number
    of technical subjects, I do not believe I have ever once seen
    you admit a mistake. Furthermore, you frequently present
    opinion as fact, despite contradictory evidence.

    Perhaps you should reflect on your own inability to admit when
    you are wrong (or just saying something for imagined cachet,
    like your frequent allusions to Knuth) before criticizing
    others.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Aug 27 16:09:28 2026
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    [...]
    I'm glad to know we are in agreement.

    We're not.

    I don't know why you say this.

    And I'm ok with that. Your reactions when I've asked you to clarify
    things in the past do not incline me to do the same for you.

    The difference here is that I didn't just ask a question, but
    gave a detailed explanation for my statement. So your response
    gives the impression of you simply not wanting to admit that
    you're wrong.

    Then let me be clear. Your impression is incorrect. I simply
    don't want to discuss it *with you*.

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

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Fri Aug 28 08:48:55 2026
    On 27/08/2026 19:04, Tim Rentsch wrote:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    [...]

    I'm glad to know we are in agreement.

    We're not.

    I don't know why you say this.

    And I'm ok with that. Your reactions when I've asked you to clarify
    things in the past do not incline me to do the same for you.

    The difference here is that I didn't just ask a question, but
    gave a detailed explanation for my statement. So your response
    gives the impression of you simply not wanting to admit that
    you're wrong.

    Given that you have done exactly this on more than one (though not many
    more) occasion, but I have never noticed Keith doing so, I find that
    answer ironic. My experience is that Keith is happy to accept when he
    is wrong - happier, no doubt, when he has learned something new rather
    than just made a mistake.

    I won't try to speak for anyone else, but Keith's response does not give
    /me/ the impression that he does not want to admit to being wrong. It
    gives the impression that he feels it is a waste of time trying to
    discuss more with you on the topic. Given how often you leave detailed
    posts from others unanswered, only to follow up with a meaningless and pointless comment several months later, I fully understand if that is
    Keith's reasoning.

    If Keith believe he had been wrong here, or suspected that he might have
    been, I think he would have said so - despite not wanting to continue
    another pointless thread with you.

    (I am not claiming to know that this is Keith's reasoning, merely saying
    the impression his post gives me.)



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)