Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C String terminator Date: Sat, 11 Apr 2020 15:04:13 -0700 Organization: None to speak of Lines: 37 Message-ID: <87h7xpk7c2.fsf@nosuchdomain.example.com> References: <2edf2e71-9692-4d9a-a112-23f8ad6b50e1@googlegroups.com> <895233b7-8933-44ca-a8e9-c5cc980ec876@googlegroups.com> <673b0629-b32e-4391-9e10-93a6e3b00ffe@googlegroups.com> <89841304-79c4-43a3-9bec-d5eab27c4a08@googlegroups.com> <3gIjG.348315$mJ2.342434@fx23.iad> <730c5155-f371-4c0d-985d-ca0e845878d4@googlegroups.com> <3aaa1e27-88f4-4134-bd9c-539f7a72fb8e@googlegroups.com> <9c2efce8-e36e-477d-b768-c412d658b6fa@googlegroups.com> <4b9b90a0-0393-41de-8857-1f8e379e4d79@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="9e0e7bbb14dcd275807e96284b4c31ae"; logging-data="9616"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BOdfU5FJ5JiJZ13shHglM" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:5LLkAWqXnS9xn1hFzlGOn0hn0YM= sha1:8HO42c67c2xfB1Abb/w6/fJBBSo= Xref: csiph.com comp.lang.c:151295 Ike Naar writes: > On 2020-04-10, Malcolm McLean wrote: >> A pure function requires that input and output bits be physically >> distinct, and that input bits be described at the point of invocation, >> and that output bits be returned to the point of invocation and >> nowhere else. > > I don't follow. Let > > int pure(int arg); > > be a pure function, and let > > int var; > > be a variable that holds a value such that pure(var) is well-defined. > Are you saying that, if we call the function as follows: > > var = pure(var); > > that now suddenly the function is no longer pure because its > input bits and output bits are not distinct? (both are the bits of 'var'). I don't think so, and though I can only speculate I don't think Malcolm thinks so either. The "input bits" for that call are (the representation of) the current *value* of var, not the object var. That value is obtained via the *lvalue conversion* described in N1570 6.3.2.1p2 before the function is called. The "output bits" are (the representation of) the function's return value. The storage of those bits in var is done by the assignment, not by the function call. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */