Sujet : Re: Top 10 most common hard skills listed on resumes...
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 31. Aug 2024, 23:31:29
Autres entêtes
Organisation : None to speak of
Message-ID : <87cylo494u.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13)
Bart <
bc@freeuk.com> writes:
[...]
Given this:
>
x + y = z;
(x + y) = z;
>
My compiler produces the same AST for the LHS of '=' in both cases.
[...]
If that's the case (and I don't doubt that it is), then your compiler is
not following the grammar specified by the ISO C standard. Since
`x + y` is not a unary-expression, `x + y = z` is not a syntactically
valid assignment expression.
A parser that strictly follows the ISO C grammar would reject
(diagnose, flag, whatever) `x + y = z;` just as it would reject `x = y +;`.
This is an observation, not a complaint. It doesn't imply that your
compiler is non-conforming or buggy. A parser that doesn't strictly
follow the ISO C grammar could still be part of a conforming compiler.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */