Sujet : Re: Top 10 most common hard skills listed on resumes...
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 11. Sep 2024, 10:52:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbrp96$3gqes$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
User-Agent : Mozilla Thunderbird
On 11/09/2024 01:02, Ben Bacarisse wrote:
Bart <bc@freeuk.com> writes:
Sorry, did your remark above suggest I don't know what an lvalue is?
That seemed like the obvious explanation for the incorrect information
you gave. Did you post it /knowing/ what other kinds of things are
lvalues in C just to confuse people?
Which incorrect explanation was that?
I merely said that LHSs of assigments fall into these categories:
A = Y; // name
*X = Y; // pointer
X[i] = Y; // index
X.m = Y; // member select
Clearly I mean VALID LHSs, otherwise they wouldn't be LHSs of assignments!
I've since learnt about a couple of other possible categories; one is with compound literals like '(int){42} = 0'. (I don't count (A), ((A)) etc as a separate category; come on!)
The other is 'X.m' but when .m is a bitfield; although this has the same same syntax as above, internally it's somewhat different. (My C compiler treats bitfields as ordinary members.)
I acknowledge that allowing 'F().m = Y' is wrong; I might get around to fixing it one day.
(In my language that would fail when F returns a value struct. It would pass if F returns a pointer to a struct, since I can still use 'F().m := Y', as derefs are automatic.
F().m := Y is valid also in my dynamic language, since the returned object can be shared so the effect of the assignment can be observable. But that's really due to underlying pointers too.)