Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #401180

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

Path csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Expression statements (was Re: Meaning of "expression")
Date Fri, 14 Aug 2026 13:40:40 -0700
Organization A noiseless patient Spider
Lines 41
Message-ID <86wlts5tbr.fsf@linuxsc.com> (permalink)
References <10v7b32$2u85v$1@dont-email.me> <10vm8tj$3uus7$7@dont-email.me> <10vmimv$2tjoi$3@kst.eternal-september.org> <86ecipcbqa.fsf@linuxsc.com> <10vnlgu$382un$2@kst.eternal-september.org> <86bjdpayv0.fsf@linuxsc.com> <10vv49k$1aoa2$4@kst.eternal-september.org> <1107aq2$3grso$2@kst.eternal-september.org> <11093p9$1nauc$1@dont-email.me> <11095su$1obc$1@dont-email.me> <110981v$1nauc$2@dont-email.me> <1109ai6$1aa$1@dont-email.me> <110a4cv$b2kq$4@kst.eternal-september.org> <110etqg$1naub$9@dont-email.me> <110f1c5$1ltqf$1@dont-email.me> <110fdaf$1naub$11@dont-email.me> <110fkk2$1qf9f$2@kst.eternal-september.org> <111pr2q$5rbd$1@dont-email.me> <111q697$3cgp8$1@kst.eternal-september.org> <86qzlq7gkr.fsf@linuxsc.com> <111shoe$3vq40$3@kst.eternal-september.org>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Date Fri, 14 Aug 2026 20:40:43 +0000 (UTC)
Injection-Info dont-email.me; logging-data="2956047"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vYH6bpxDdzyqoZHUssmjL0z18h3gfATc="; posting-host="34d543ba31754db8d869ebd4dc5daf69"
User-Agent Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock sha1:N8JKs26z5LAdPAjbT7+oHAwDWB0= sha1:t+YCL5vFLFJTcFSkMMDMD++hSUw= sha256:9Ef2NcACKPJEfvn/m13YohmcnBcdH0cp5wHXsVotozM= sha1:F4uJaEV6vD5AzlTox1QX1wyxR6o= sha256:nIq4Hi5wUZejiEUNrHp0OTPmtedp30SBBwbKALaePBU=
Xref csiph.com comp.lang.c:401180

Show key headers only | View raw


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.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Expression statements (was Re: Meaning of "expression") Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-06-28 02:49 +0200
  Re: Expression statements (was Re: Meaning of "expression") Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-06-27 21:00 -0700
    Re: Expression statements (was Re: Meaning of "expression") Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-06-28 09:52 -0700
      Re: Expression statements (was Re: Meaning of "expression") Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-06-28 18:28 -0700
        Re: Expression statements (was Re: Meaning of "expression") Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-14 13:40 -0700
          Re: Expression statements (was Re: Meaning of "expression") Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-14 14:13 -0700
            Re: Expression statements (was Re: Meaning of "expression") Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-08-19 08:32 -0700
              Re: Expression statements (was Re: Meaning of "expression") Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-08-19 15:09 -0700

csiph-web