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: Sat, 02 May 2026 10:54:39 -0700 Organization: A noiseless patient Spider Lines: 19 Message-ID: <861pftzogw.fsf@linuxsc.com> References: <10su8cn$am9i$1@dont-email.me> <10sv4v0$h9mn$1@dont-email.me> <84c1c180f4d5b96259a631bdb09b6054b4eb44d2.camel@gmail.com> <10svgfv$l2bu$1@dont-email.me> <10t4hse$22u36$1@dont-email.me> <97a1c40bf71cfe8edab25d5ac8a1ad435c3995e5.camel@gmail.com> <10t4t8v$25van$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sat, 02 May 2026 17:54:40 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2461758"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CTmR5gYm3K4mU2n+fCeERo+thYRw24BQ="; posting-host="0224f8b6fcff9256362aa20147bea6bc" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:kCpLwSxU2oIOhq5AQhhnEt+/600= sha1:IuomxRimcv50RtI3hMk1xrRnx5I= sha256:HVBhkS6acKEE6vWoqqljF0ngmrkbgZWh32ygRjhiCzw= sha1:d3H1oVNfaC6na1uy0IVIqeSlYTw= sha256:HUG0A8/pp9Dw4rc9rgpQ/URjMO1qsefCIYZ7RGCA8ls= sha1:5YJKhzDWJljdr/291fNd7lvaqzY= Xref: csiph.com comp.lang.c:398184 wij writes: > What does "abstract machine" mean exactly? The term "abstract machine" comes from the ISO C standard. It refers to an environment in which the behavior of constructs in the C language can be defined, and which is independent of any actual hardware or compiler. It's an important concept to understand, for anyone who wants to reason about what C programs are supposed to do, what they are allowed to do by the C standard, and what they are not allowed to do if being run on a conforming implementation of ISO C. Note that there is nothing stopping a compiler from claiming to be a "C compiler," even if it doesn't conform to the requirements of the ISO C standard. That is why it's important to understand what are the rules of the "abstract machine", because it allows us to talk about what to expect of C programs, without having to refer to how any particular hardware behaves, or what any particular compiler does, but just considering the C program itself.