jacob navia said:
Thanks. You agree with me then, that the object exists, and exists
before the call, even if it is not accessible.
I didn't say that, but I agree, more or less.
This is obvious if we read the standard 6.5.2.2 "Function calls",
where it is specified that after all assignments are done to the
function arguments there is a sequence point. At that sequence point
the arguments have been assigned but they are still not accessible
since the function call is not done yet.
Obviously the objects exist within the function call. They have a
constant address, and they retain their last assigned value.
An *argument* is not an object. An argument is an expression
appearing between the parentheses in a function call; see C99 3.3.
A *parameter* is an object; see C99 3.15. Please keep the
terminology straight.
The standard is a bit vague, and perhaps even contradictory, about
the lifetime of a parameter. See C99 6.5.2.2p4:
An argument may be an expression of any object type. In preparing
for the call to a function, the arguments are evaluated, and each
parameter is assigned the value of the corresponding argument.
implying that a parameter is created before the function is called.
But C99 6.9.1p9 says:
Each parameter has automatic storage duration. Its identifier is
an lvalue, which is in effect declared at the head of the compound
statement that constitutes the function body (and therefore cannot
be redeclared in the function body except in an enclosed block).
which implies that the parameter object isn't created until control
passes the opening '{' of the function.
I'm not suggesting that this is a real problem in the standard, just
that it's difficult to say whether a parameter object exists before
the function is called.
But in any case, the question from upthread is whether this statement:
toupper((unsigned char)c);
contains an lvalue. c is an lvalue, but (unsigned char)c is not, and
statement does *not* contain an lvalue that refers to the parameter.