• Re: this girl calls c ugly

    From Tim Rentsch@tr.17687@z991.linuxsc.com to comp.lang.c on Sat Aug 15 09:37:03 2026
    From Newsgroup: comp.lang.c

    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:

    [...]

    You made a statement, "gcc disagrees with you". I demonstrated,
    in text that you snipped, that gcc does in fact agree with me.

    No, you didn't.

    Yes, I did.

    You were wrong.

    No, I wasn't. Your testing was faulty.

    Yes, you were. My testing was not faulty.

    Oddly enough, your response reminds me of an observation
    reportedly attributed to Leonaro da Vinci.

    ~ $ cd demo
    ~/demo $ /bin/ls
    ce.c
    ~/demo $ cat ce.c
    #include <limits.h>

    int
    main(){
    switch(1){
    case (INT_MAX+1)*0: return 1;
    default: return 0;
    }
    }
    ~/demo $ gcc -std=c99 -pedantic-errors -Wno-overflow -o gcc-ce ce.c
    ~/demo $ clang -std=c99 -pedantic-errors -Wno-integer-overflow -o clang-ce ce.c ~/demo $ /bin/ls
    ce.c clang-ce gcc-ce
    ~/demo $ ./gcc-ce
    ~/demo $ echo $?
    0
    ~/demo $ ./clang-ce
    ~/demo $ echo $?
    0
    ~/demo $
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Tim Rentsch@tr.17687@z991.linuxsc.com to comp.lang.c on Sat Aug 15 09:37:48 2026
    From Newsgroup: comp.lang.c

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

    cross@spitfire.i.gajendra.net (Dan Cross) writes:
    [...]

    The text of the standard explicitly carves this out; or, rather,
    it attempts to. If the result of an expression is not
    representable in the target type, _regardless of whether that's
    due to UB or not_, a diagnostic is required.

    [...]

    How would an expression (appearing in a context that requires an
    integer constant expression) not "evaluate to a constant that is in
    the range of representable values for its type" other than by UB?

    I can think of one.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Keith Thompson@Keith.S.Thompson+u@gmail.com to comp.lang.c on Sat Aug 15 17:29:33 2026
    From Newsgroup: comp.lang.c

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    cross@spitfire.i.gajendra.net (Dan Cross) writes:
    [...]

    The text of the standard explicitly carves this out; or, rather,
    it attempts to. If the result of an expression is not
    representable in the target type, _regardless of whether that's
    due to UB or not_, a diagnostic is required.

    [...]

    How would an expression (appearing in a context that requires an
    integer constant expression) not "evaluate to a constant that is in
    the range of representable values for its type" other than by UB?

    I can think of one.

    So you've decided to be a troll.
    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */
    --- Synchronet 3.22a-Linux NewsLink 1.2