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 valid C? Date: Sun, 19 Feb 2017 15:54:25 -0800 Organization: None to speak of Lines: 32 Message-ID: References: <87shnab3c5.fsf@bsb.me.uk> <87wpclaoqs.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="9029eb194d173f90c26f49eb1843bbfe"; logging-data="14078"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZnhP0LK0Hb+GG5UdUUSwE" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:u1JZwWsXAXrjKl4MEghfnjlq+Ew= sha1:HIgTD94zN+fJz3TL4hP9b12/h9k= Xref: csiph.com comp.lang.c:104244 Ben Bacarisse writes: > Keith Thompson writes: [...] >> (x,C) is invalid because x and C are of integer and pointer type, >> respectively. > > I don't follow this. (x,C) is a comma expression and looks valid to me. You're right. (I was thinking of the requirements on the 2nd and 3rd operands of the ?: operator.) [...] >> I believe that an array member of a function call of struct type is the >> *only* case where it's possible to have an array expression that's not >> an lvalue in C90. In C90, the array-to-pointer conversion rules >> implicitly assumed that the array expression refers to an array object >> (to whose initial element the resulting pointer points). To fix that >> oversight, C99 introduced objects of *temporary lifetime*, so now >> there's an object for the resulting pointer to point to. > > (I think you mean C11.) Right again. [...] -- 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"