Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Safety of casting from 'long' to 'int' Date: Wed, 13 May 2026 15:28:30 -0700 Organization: A noiseless patient Spider Lines: 37 Message-ID: <86ik8rj65t.fsf@linuxsc.com> References: <10su8cn$am9i$1@dont-email.me> <10thb36$1prnt$1@kst.eternal-september.org> <10tlc73$qq2$1@reader1.panix.com> <86lddnlvtr.fsf@linuxsc.com> <10u26f0$t9e$1@reader1.panix.com> <10u2hmc$2t96p$3@kst.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Wed, 13 May 2026 22:28:31 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3179643"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19toM3no8QcE4gyr8DSvy4NxPL87XcZgUo="; posting-host="ace8b6eaa328dcf44f89a3207699c4cb" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:lJGrU17cPumho/g+u4r5NCLD6hY= sha1:96Ue2Zab2TPtsgzul6TPTqDTkWw= sha256:gtFkwk7ofAniEK6F0qKehvvMmhKBrRj7x9aso3lMZRU= sha1:OQvRAxRAHD0FZLdYQGEd5umKex8= Xref: csiph.com comp.lang.c:398908 Keith Thompson writes: > cross@spitfire.i.gajendra.net (Dan Cross) writes: > >> In article <86lddnlvtr.fsf@linuxsc.com>, >> Tim Rentsch wrote: > > [...] > >>> Starting in C99, any mention of interrupts and signal handlers was >>> removed, along with the carveout. >> >> This is wrong. Section 7.14 of C23 talks about signals and >> signal handlers at length. > > Obviously, but that's clearly not what Tim meant. His statement > was not wrong in context. (7.14 describes . It's not > plausible that Tim would think that had been removed.) > >> I never mentioned "interrupts" at all (traditionally, Unix >> signals, which formed the basis for C signals, are not >> interrputs in the conventional sense. Modern systems will >> sometimes make use of interprocessor-interrupts to hasten their >> delivery, however). >> >> I think you are talking about _only_ the description of >> `longjmp`. I am actually talking about the standard considered >> in total. I only mentioned "non-nested" signal handler because >> C90 was explicit in saying that that `longjmp` from a _nested_ >> signal handler was UB. > > Yes, Tim was clearly talking only about the descrition of longjmp. > His statement wasn't wrong, just restricted to a certain context. > C90's description of of longjmp includes a paragraph about interrupts > and signals. C99 removed that paragraph. Right. Thank you for clarifying.