Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.std.c Subject: Re: Why is shifting too far undefined behvaior? Date: Tue, 21 Sep 2021 21:12:07 -0700 Organization: None to speak of Lines: 36 Message-ID: <87v92tmep4.fsf@nosuchdomain.example.com> References: <20210922011447$3630@zira.vinc17.org> <87zgs5mkk6.fsf@nosuchdomain.example.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="b5fd9637bf49c8f43a3bd672d60f3caf"; logging-data="8395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ua5DLnoaZ1KRgwv5gPzfO" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:mL916ulzsBSaRFqbt/x9XP89zUM= sha1:OPRhbjuSE4PDVPdoCXirFQdJb20= Xref: csiph.com comp.std.c:6311 James Kuyper writes: > On 9/21/21 10:05 PM, Keith Thompson wrote: >> Vincent Lefevre writes: >>> In article , >>> Richard Damon wrote: >>> >>>> The wording probably could be changed to something like an unspecified >>>> value or a trap, >>> [...] >>> >>> Note: an unspecified value or a trap = an indeterminate value >> >> An indeterminate value is either an unspecified value or a trap >> *representation". Richard didn't say "trap representation" (I won't >> attempt to guess whether that's what he meant.) >> >> A "trap" (not a term used by the standard) usually means that the >> program terminates in some unfriendly way -- which might as well be >> undefined behavior. > > True. But "perform a trap" is a term defined by the standard as meaning > "interrupt execution of the program such that no further operations are > performed". Per footnote 2, "fetching a trap representation might > perform a trap, but is not required to do so". You're right. That definition is N1570 3.19.4. > While I agree that "trap representation" is most likely what he meant, > "perform a trap" is an alternative possibility. (BTW, you sent your reply to me by email as well as posting it here.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips void Void(void) { Void(); } /* The recursive call of the void */