Deutsch English Français Italiano |
<87ikv0y864.fsf@nosuchdomain.example.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: Top 10 most common hard skills listed on resumes... Date: Thu, 12 Sep 2024 12:38:11 -0700 Organization: None to speak of Lines: 77 Message-ID: <87ikv0y864.fsf@nosuchdomain.example.com> References: <vab101$3er$1@reader1.panix.com> <87v7zjuyd8.fsf@bsb.me.uk> <20240829084851.962@kylheku.com> <87mskvuxe9.fsf@bsb.me.uk> <vaq9tu$1te8$1@dont-email.me> <vbci8r$1c9e8$1@paganini.bofh.team> <vbcs65$eabn$1@dont-email.me> <vbekut$1kd24$1@paganini.bofh.team> <vbepcb$q6p2$1@dont-email.me> <vbgb5q$1ruv8$1@paganini.bofh.team> <vbhbbb$1blt4$1@dont-email.me> <87tteqktr8.fsf@bsb.me.uk> <vbkjqk$201ms$1@dont-email.me> <87ttenk2nq.fsf@bsb.me.uk> <vbps3c$31s4d$1@dont-email.me> <vbtik7$38tme$1@paganini.bofh.team> <vbuj67$733i$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 12 Sep 2024 21:38:12 +0200 (CEST) Injection-Info: dont-email.me; posting-host="4b8fa2c92ce4a3b1e07f703ae75bae6f"; logging-data="401748"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7nOcKakxWANKcdthkQnMt" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:hAiIKL05ebRKPFeD3J1En7vKBrE= sha1:ebrfqNV1k0o5X07TRlCqAXUVm7c= Bytes: 4411 Bart <bc@freeuk.com> writes: [...] > It's not that complicated, not with C anyway. > > Because in C, if you take the 3-4 categories of LHS in assignments > (ignore the esoteric ones, and [] and . are really the same), there is > only one top-level lvalue node to consider. I agree, there's only one thing to consider. The LHS of an assignment is a modifiable lvalue. We've spent a lot of time arguing about how any "categories" there are for the LHS of an assignment. If I recall correctly, the whole thing started when you stated that "the LHS of an assignment is one of four categories", leading to a debate about whether four is the correct number. Enumerating the kinds of expressions that can be modifiable lvalues is interesting, I suppose, but are A and (A) in different "categories"? Is it important to count generic selections and compound literals? Who cares, and why? > That's the only thing that needs to 'change', which I don't think is > onerous anyway. I don't know what you're saying needs to change. > With more elaborate LHSs, for example like this: > > (A[i], B[i], (x ? C.m : D.m) = Y(); > > There can be both multiple and nested lvalue nodes. So 'lvalueness' > has to somehow propagate down into those branches after parsing has > been done. > > And yet, I was doing that in the 1980s on my toy compilers. So that's > not that hard either. Ok, it's not that hard to implement things that are not valid C. Are you suggesting that anything that's easy to implement should be added to the language standard? It's not that simple. Most of the time, I'm more interested in discussing what's actually in C than what could be added. And ease of implementation is only one thing to consider when adding a new feature, and probably not the most important. [...] > What exactly /is/ lvalue conversion? What is converted to what? This is specified in the C standard (6.3.2.1p2 in C11, 6.3.3.1p2 in C23 drafts). I suggest you read it. An lvalue (an expression that designates an object) is converted to the value stored in the designated object. This conversion (adjustment) does not occur on the LHS of an assignment or in several other contexts. It might have been clearer to say that the expression is adjusted from an expression that designates an object (an lvalue) to an expression that yields the value of that object (not an lvalue) Note that this is not a run-time conversion, like a conversion of an integer value to a floating-point value. The standard uses the word "conversion" to refer both to run-time operations that take a value of one type and yield a value of another type, and to compile-time adjustments that change the way an expression is handled. Array-to-pointer conversion is another example of the latter. [...] -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */