Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #53893

Re: "lvalue"

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: "lvalue"
Date 2014-12-04 11:44 -0500
Organization Self
Message-ID <54808F73.8040103@verizon.net> (permalink)
References (3 earlier) <m5nml1$gho$1@dont-email.me> <547F72A6.8030502@verizon.net> <lvalue-20141204013653@ram.dialup.fu-berlin.de> <m5oi1f$jmq$1@dont-email.me> <lniohrpetm.fsf@nuthaus.mib.org>

Show all headers | View raw


On 12/04/2014 11:20 AM, Keith Thompson wrote:
> James Kuyper <jameskuyper@verizon.net> writes:
>> On 12/03/2014 07:38 PM, Stefan Ram wrote:
...
>>>       or if it has the form
>>>
>>>         *E,
>>>
>>>       where E is an expression of pointer type
>>
>> You need to be more specific - it should be a pointer to an object type,
>> and it must point at an actual object (6.5.3.2p4)
> 
> What do you mean by "it must point to an actual object"?  If E is of
> type int*, for example, then *E is an lvalue even if E is a null
> pointer.  Actually that last part mixes source code and execution time
> concepts.


(6.5.3.2p4) "If the operand points ... to an object, the result is an
lvalue designating the object."

If the operand is a pointer expression of type "pointer to object", and
it doesn't point to an object, the expression *E has undefined behavior,
so whether or not the result is an lvalue is irrelevant.

Exception: when *E occurs in the expression &*E, neither the & nor the *
is evaluated, so the behavior would not be undefined. The result is
equivalent to E, except that it is not an lvalue (6.5.3.2p3), even if E
itself is.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: "lvalue" buja <buja66@gmail.com> - 2014-12-03 18:34 +0100
  Re: "lvalue" James Kuyper <jameskuyper@verizon.net> - 2014-12-03 13:03 -0500
  Re: "lvalue" jacob navia <jacob@spamsink.net> - 2014-12-03 19:29 +0100
    Re: "lvalue" buja <buja66@gmail.com> - 2014-12-03 20:01 +0100
      Re: "lvalue" Keith Thompson <kst-u@mib.org> - 2014-12-03 12:18 -0800
      Re: "lvalue" Geoff <geoff@invalid.invalid> - 2014-12-03 12:20 -0800
      Re: "lvalue" James Kuyper <jameskuyper@verizon.net> - 2014-12-03 15:29 -0500
        Re: "lvalue" James Kuyper <jameskuyper@verizon.net> - 2014-12-03 21:48 -0500
          Re: "lvalue" Keith Thompson <kst-u@mib.org> - 2014-12-04 08:20 -0800
            Re: "lvalue" James Kuyper <jameskuyper@verizon.net> - 2014-12-04 11:44 -0500
              Re: "lvalue" Keith Thompson <kst-u@mib.org> - 2014-12-04 11:41 -0800
                Re: "lvalue" James Kuyper <jameskuyper@verizon.net> - 2014-12-04 14:50 -0500
        Re: "lvalue" Keith Thompson <kst-u@mib.org> - 2014-12-03 23:40 -0800
    Re: "lvalue" Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-05 09:16 -0800

csiph-web