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: IEEE: C is the first programming language Date: Thu, 28 Jul 2016 09:06:54 -0700 Organization: None to speak of Lines: 28 Message-ID: References: <373211b1-a3c7-4b42-85d7-0862cc962b08@googlegroups.com> <025b517e-bd9e-4464-ab32-0d5cadb4bf99@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="26014"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+y9V7tjCvpc8xWXU0dxz9R" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:yaqAN3T9BpC0nY3tDq/tzqUTZvM= sha1:oHYDwk2NyL41d+z6Y5Q+u+Gogbs= Xref: csiph.com comp.lang.c:91244 supercat@casperkitty.com writes: > On Thursday, July 28, 2016 at 1:52:34 AM UTC-5, Les Cargill wrote: >> Which "dialect" of 'C' supports constrained overflow? You talking about >> the saturation overflow semantics of certain DSPs? > > How about the very first one? Dennis Ritchie's "printf" function given in > his documentation very clearly relies upon the fact that -(-327678) yields > -32768. I would consider him the first and foremost authority on what was > and was not guaranteed in his language at the time, and I would not expect > him to write such code if he didn't think his compiler would reliably > support it. That would be at least one dialect, but there are many more > besides. So by "constrained overflow" you meant 2's-complement wraparound semantics. That wasn't at all clear. In modern terms, printf is part of the implementation, and its code is free to depend on any compiler-specific behavior it likes. Ritchie presumably would not have relied on that assumption if he were writing code intended to run on one's-complement systems. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org 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"