Path: csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.std.c Subject: Re: Does reading an uninitialized object have undefined behavior? Date: Tue, 25 Jul 2023 21:57:20 -0700 Organization: A noiseless patient Spider Lines: 26 Message-ID: <86zg3jqngv.fsf@linuxsc.com> References: <87zg3pq1ym.fsf@nosuchdomain.example.com> <20230721002225.404@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: dont-email.me; posting-host="5ba297a04e2080c4db730e1e3158367c"; logging-data="1490722"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UmqnCOL26kshtJV5WN9FqxF5imATbtRU=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:5RCPIb/KnV/i2OpF1NGaokrv1ps= sha1:WB9r1LSm03V/uEVM5BkkTDdvzbY= Xref: csiph.com comp.std.c:6521 Jakob Bohm writes: > On 2023-07-21 19:42, Kaz Kylheku wrote: > >> On 2023-07-21, Keith Thompson wrote: >> >>> N3096 is the last public draft of the upcoming C23 standard. >>> >>> N3096 J.2 says: >>> >>> The behavior is undefined in the following circumstances: >>> [...] >>> (11) The value of an object with automatic storage duration is >>> used while the object has an indeterminate representation >>> (6.2.4, 6.7.10, 6.8). >> >> Personally, I think that the root cause of this whole issue is >> the defective definition of indeterminate value. > > The problem is much deeper than that. It all boils down to the > obsession in the official C community to abuse the concept of > "undefined" to cover everything from "arbitrary natural semantics > of the hardware" to "optimizing away code unexpectedly" . [...] This discussion looks interesting but it seems better that there be a separate thread to take it up.