Groups | Search | Server Info | Keyboard shortcuts | Login | Register
Groups > comp.lang.c > #392923
| Path | csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Tim Rentsch <tr.17687@z991.linuxsc.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: Bart's Language |
| Date | Sun, 27 Apr 2025 11:53:05 -0700 |
| Organization | A noiseless patient Spider |
| Lines | 32 |
| Message-ID | <86wmb58mi6.fsf@linuxsc.com> (permalink) |
| References | <vracit$178ka$1@dont-email.me> <vrbo88$1j3e0$1@paganini.bofh.team> <vrbtve$2irc9$1@dont-email.me> <vrc2d5$1jjrf$1@paganini.bofh.team> <vrc4eb$2p28t$1@dont-email.me> <vri6co$26v8m$2@paganini.bofh.team> <87a59fs2xm.fsf@nosuchdomain.example.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Date | Sun, 27 Apr 2025 20:53:09 +0200 (CEST) |
| Injection-Info | dont-email.me; posting-host="dc2911ce881fc369ab336d464007b401"; logging-data="1512646"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196GUfP14wBhjqN1RLXguu5AVjejXRS17g=" |
| User-Agent | Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) |
| Cancel-Lock | sha1:IxERD0LwPbOzX40rHOyd7nYXcKc= sha1:12sBit3Y+Jf3Q1wUwTRz6wy8ne0= |
| Xref | csiph.com comp.lang.c:392923 |
Show key headers only | View raw
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> antispam@fricas.org (Waldek Hebisch) writes:
> [...]
>
>> Well, it is rather easy to see if variable is used within its
>> own initialization, so practically it is minor gap. Of course,
>> there is problem with C standard: IIUC depending on rest of
>> the code declarations as above are merely undefined behaviour
>> or even produce unspecified value. So C compiler is
>> forbidden to stop compilation are report compile time error.
>
> Valid responses to undefined behavior include "terminating a translation
> or execution (with the issuance of a diagnostic message)".
That's true, but doing so is allowed only if the circumstances
of undefined behavior have occurred. In the case of compiling
a declaration such as
int a = a;
no undefined behavior has as yet occurred.
> In other
> words, if a compiler is able to prove that a program has undefined
> behavior (that will occur on each execution), it can reject it at
> compile time.
The program can be rejected, but not because of the rule about
terminating a translation. The program can be rejected because
the program is not strictly conforming, and implementations are
not required to accept programs that are not strictly conforming.
Back to comp.lang.c | Previous | Next — Next in thread | Find similar
Re: Bart's Language Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-04-27 11:53 -0700 Re: Bart's Language Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-27 14:29 -0700
csiph-web