Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Is this code considered to transgress the signed overflow purism? Date: Fri, 28 Apr 2017 09:22:24 -0700 Organization: None to speak of Lines: 17 Message-ID: References: <11ea6682-cdee-4513-97c2-6c90b585716a@googlegroups.com> <87o9vi6rql.fsf@bsb.me.uk> <26aee5e9-ed2f-4c6e-af68-b85418c7e641@googlegroups.com> <1f9a4820-c10f-4130-90c2-464b4bd48c5d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="2e5ec5e1f0fe87e81c65a0e293e55e1b"; logging-data="28983"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NZYIhMaNvTJZqlmwGOxAR" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:ZLOkL3tkEuMkdiZocR9/BqLFWqs= sha1:CEbOiIYBe+QHFeUmrs9qKpkRryE= Xref: csiph.com comp.lang.c:108670 supercat@casperkitty.com writes: [...] > Incidentally, if a platform with 32-bit "int" defines 1<<31 as -1 (likely > on platforms that also handle C++, as C++ would require such behavior), > then if "x" is "long long", then a compiler would likely have to generate > code for x*(1< would almost certainly be less efficient than x< 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"