Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.std.c Subject: Re: contradiction about the INFINITY macro Date: Mon, 15 Nov 2021 07:59:00 -0800 Organization: A noiseless patient Spider Lines: 42 Message-ID: <86v90t8l6j.fsf@linuxsc.com> References: <20210930012112$48d9@zira.vinc17.org> <87pmsqizrh.fsf@nosuchdomain.example.com> <20210930105413$d6e8@zira.vinc17.org> <86wnmoov7c.fsf@linuxsc.com> <20211009201151$a68b@zira.vinc17.org> <861r3pbbwh.fsf@linuxsc.com> <20211110124948$eea4@zira.vinc17.org> <86wnlg9ey7.fsf@linuxsc.com> <20211112231854$195e@zira.vinc17.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="318fcdd23c22fa8292d1f28db87d3a41"; logging-data="3062"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+sMiQ6auwUhg5h7H6ydreVIVpiJmaoHw=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:yfs4j9VD2VX9U4lowDooIiCxuB4= sha1:TaEraIXcPG33udQtrS0ZMsrDra4= Xref: csiph.com comp.std.c:6383 Vincent Lefevre writes: > In article <86wnlg9ey7.fsf@linuxsc.com>, > Tim Rentsch wrote: > >> Suppose we have an implementation that does not support >> infinities, a range of double and long double up to about ten to >> the 99999, and ask it to translate the following .c file >> >> double way_too_big = 1.e1000000; >> >> This constant value violates the constraint in 6.4.4. Do you >> think this .c file (and any program it is part of) has undefined >> behavior? If so, do you think any constraint violation implies >> undefined behavior, or just some of them? > > I think that constraints are there to define conditions under which > specifications make sense. Thus, if a constraint is not satisfied, > behavior is undefined [...] Suppose again we have an implementation that does not support infinities and has a range of double and long double up to about ten to the 99999. Question one: as far as the C standard is concerned, is the treatment of this .c file double way_too_big = 1.e1000000; and of this .c file #include double way_too_big = INFINITY; the same in the two cases? (The question is meant to disregard differences that are purely implementation choices, as for example possibly labelling one case a "warning" and the other case an "error".) Question two: does the C standard require that at least one diagnostic be issued for each of the above .c files? Note that both of these are yes/no questions.