Keith said:
No, the existence of an object depends on
the definition in the standard.
I suppose that it also depends upon the code.
For a declared object, such as "int y;",
the standard says y is an object.
An implementation is allowed not to allocate storage for it,
if this optimization doesn't change the effect of the program,
but it's still an object in the abstract machine.
This appears to be consistent with my assertion that
"and object is a value that *could* occupy storage.
For an expression such as 42, the standard does not say that
there is an object associated with the value of the expression.
An implementation may allocate an int-sized region of storage
holding the value 42,
but there's still no object in the abstract machine.
int x = 42;
How does the "abstract machine" know that
x is initialized with the value 42?
A C program is correspondence from the programmer to the C compiler
and not any underlying abstract [or concrete] machine.
Optimization does not affect
whether something is an object as defined by the standard.
According to Brian W. Kernighan and Dennis M. Ritchie,
"The C Programming Language", Appendix A: C Reference Manual,
Section 5. Objects and lvalues:
" An object is a manipulatable region of storage;
an lvalue is an expression referring to an object.
An obvious example of an lvalue expression is an identifier.
There are operators which yield lvalues: for example,
if E is an expression of pointer type,
then *E is an lvalue expression
referring to the object to which E points.
The name ``lvalue'' comes from the assignment expression E1 = E2
in which the left operand E1 must be an lvalue expression."
Notice that K&R don't specify that constants are not objects.
The term ``object'' is introduced to help explain
the notion of ``lvalue'' but it is flawed.
It appears to imply that objects are *always* variables
which was true in the original definition of C.
Constants were always *literal* constants.
The C 89 standard introduced the ``const'' keyword
to qualify "read-only" storage and the const variable oxymoron.
This is a fundamental flaw in the design of the C language.
No redefinition of ordinary English words like object
is going to resolve it.
C programmers are *not* true believers.
The C standards documents are *not* religious dogma.
They were *not* carved in stone by God
and brought down from Mount Sinai by Moses.
They were written by human beings and, in cases like this,
they expose the muddled thinking of those human beings.
They deserve the same critical skepticism that you apply
to articles submitted to the comp.lang.c newsgroup.