[in C99]
I agree with Kal, and Dan! Surprise! But Dan has his tongue firmly
in cheek and Kal does not. My $ 0.02 follows without tongue in cheek.
First the expression 3 is a value of int type. 3 is not an object
and has no object type. Values don't have object type. Only
expressions designating objects have object type.
This is wrong (and FWIW, I don't think Dan was speaking tongue-in-
cheek at all; he was quoting the Standard). 'int' is MOST DEFINITELY
an 'object type'. It is most definitely NOT a 'function type' nor an
'incomplete type'. You can't deny that.
Some wording in C99 muddies this up some and Dan is pointing it out.
Nobody really thinks that 3 = 4; is legal, they're just poking fun
at the Standard that seems to say so. I guess.
You guess wrongly. Here's the situation.
(A) The word "lvalue" in general CS jargon means "something with
an address, or something assignable-to." Something along
those lines. This definition is, strictly speaking, off-topic
in comp.lang.c.
(B) The C89/C90 Standard defines 'lvalue' to include 'i' but
exclude '3', to use your example. Thus the C90 'lvalue'
corresponds almost exactly to the general-CS definition
in (A), modulo any corner cases, of which I'm sure there must
be a few.
(C) The C99 standard defines 'lvalue' to include both 'i' AND '3'.
Thus, the C99 'lvalue' does not correspond to either (A) or
(B).
(D) The statement '3 = 4;' is not legal in either C90 or C99.
Neither standard says or implies that it is legal. However,
in C90 we can also say that '3' is not an lvalue (and thus a
general knowledge of CS jargon will suggest that it can't
legally appear on the left side of an assignment); in C99,
since '3' IS an lvalue, we have to actually consult the
rest of the language definition to convince ourselves that
the expression '3 = 4' is invalid (or else use our general
knowledge of CS to realize that we obviously can't assign
anything to '3'; it just doesn't work).