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: Fri, 18 Aug 2023 22:56:34 -0700 Organization: A noiseless patient Spider Lines: 25 Message-ID: <86sf8f4lt9.fsf@linuxsc.com> References: <87zg3pq1ym.fsf@nosuchdomain.example.com> <87zg3pnuse.fsf@bsb.me.uk> <874jlxozzz.fsf@nosuchdomain.example.com> <87fs5hnipv.fsf@bsb.me.uk> <87a5vpnegz.fsf@nosuchdomain.example.com> <86a5uv95g7.fsf@linuxsc.com> <864jkz7hrm.fsf@linuxsc.com> <867cpu5h8w.fsf@linuxsc.com> <20230816235712.844@kylheku.com> <86wmxr4t22.fsf@linuxsc.com> <20230818220442.950@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: dont-email.me; posting-host="fd3ada769e75711f4f8ff6c26696c0a7"; logging-data="695252"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CYVZVqDQ5ivbNvlmiiQC7G6PsNp2fUxY=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:4bl42fWyowyExexIorknMZB5A20= sha1:LcFmDHOm/4wkRYBYVLxQ9BRiVO0= Xref: csiph.com comp.std.c:6551 Kaz Kylheku <864-117-4973@kylheku.com> writes: > On 2023-08-19, Tim Rentsch wrote: [...] >> The C standard allows compilers to do whatever analysis they >> want and to issue diagnostics for whatever conditions or >> circumstances they choose. > > And stop translating? If some use of an uninitialized object > isn't undefined, and you make the diagnostic a fatal error, > then you don't have a conforming compiler at that point. > > [also] > > If the program hasn't invoked undefined behavior, I don't thinkk > it's conforming to inject gratuitous diagnostics [..or..] > to arbitrarily terminate the program. [...] You need to learn how to say what you mean. Your earlier posting didn't say anything about failing to compile or altering program behavior. If you can't learn how to say what you mean then there is roughly a 1e-29 percent chance that you'll get what you want.