Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: lvalue types Date: Tue, 17 Apr 2018 10:37:25 -0700 Organization: None to speak of Lines: 39 Message-ID: References: <2b687d74-f559-43a9-9aec-8a1067467ce2@googlegroups.com> <5fe67088-8e80-478e-a622-02d16b64166a@googlegroups.com> <65e621e1-9bc2-4558-a36d-9712e792494f@googlegroups.com> <117929cb-d6aa-45bc-a5d4-8566bb8c6d58@googlegroups.com> <33a55bca-4174-4e74-9444-8f7f2014b1ad@googlegroups.com> <390abe70-908f-4f19-b6f8-84ec38d3ea90@googlegroups.com> <64746e6c-0c23-47a6-a5d4-d15a33db4aed@googlegroups.com> <83589df8-fa61-4ffb-8fef-09ab50c8fcf4@googlegroups.com> <646ca446-53a3-4006-a476-6f52caacd8c9@googlegroups.com> <108b8472-481e-43b4-9988-2c7e4648449d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="dcaeb3e1ef05ac06fdd3cc3805c02cf2"; logging-data="13355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/l3a7f5Smmn0NwSWzIkYRv" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:tjdL0k2US0nkXSuR8zMtvUc8Q6g= sha1:0mKrd2lukls8U0Q2QR5deF9tWSQ= Xref: csiph.com comp.lang.c:129354 supercat@casperkitty.com writes: > On Tuesday, April 17, 2018 at 10:48:35 AM UTC-5, Keith Thompson wrote: >> supercat@casperkitty.com writes: >> > The paragraph, as written, makes any program that uses structures containing >> > non-character members and doesn't jump through absurd hoops to do is not >> > strictly conforming, even if it would otherwise (in the absence of that >> > paragraph) be strictly conforming and there would be no ambiguity as to its >> > meaning. >> >> Strict conformance is not the point. The point is that, as written >> (assuming my reading of the literal wording is correct), it causes >> such programs to have undefined behavior, a much stronger statement. >> >> This: >> printf("%zu\n", sizeof (int)); >> cannot appear in a strictly conforming program, but its behavior is well >> defined (and its output implementation-defined). > > The Standard does not define any category of "portable" programs that are > not Strictly Conforming. On the other hand, since it does explicitly > say that any code which invokes UB is either non-portable or erroneous, > perhaps my objection should be that the Standard says that code which tries > to use non-character members of structs or unions in what should be the > obvious logical fashion is either non-portable or erroneous, and the fact > that implementations happen to behave sensibly even though they are not > required to do so doesn't change that. Or you could just say that the standard as currently written says the behavior is undefined (because it violates a "shall" outside a constraint), and save us all a lot of time. I fail to see the point of going off on a tangent about categories of "portable" programs. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"