Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: "lvalue" |
| Date | 2014-12-03 23:40 -0800 |
| Organization | None to speak of |
| Message-ID | <lnmw73q2vi.fsf@nuthaus.mib.org> (permalink) |
| References | (1 earlier) <m5nhhr$qda$1@dont-email.me> <m5nkqb$6qk$1@speranza.aioe.org> <m5nml1$gho$1@dont-email.me> <547F72A6.8030502@verizon.net> <lvalue-20141204013653@ram.dialup.fu-berlin.de> |
ram@zedat.fu-berlin.de (Stefan Ram) writes:
> James Kuyper <jameskuyper@verizon.net> writes:
>>Those two statements cannot both be true. The current standard is
>>intended to identify *p as an lvalue, even if p has a null or
>>indeterminate value, in which case *p does NOT refer to an object. C90's
>
> An attempt by me:
>
> »An expression is an /lvalue expression/,
> if it has the form
>
> v,
>
> where v is a variable or a parameter,
> or if it has the form
>
> *E,
>
> where E is an expression of pointer type
> (or an equivalent expression written with
> the [] operator)«
The standard doesn't define the word "variable". The word "object"
covers both declared variables and parameters. An identifier is an
lvalue if and only if it's an object name.
A parenthesized lvalue is an lvalue.
*E is an lvalue only if E is of object pointer type; if E is a function
pointer, *E is not an lvalue.
A string literal is an lvalue.
X.Y, where X is an lvalue of struct or union type, is an lvalue.
A compound literal is an lvalue.
And as you said, *E or E1[E2] is an lvalue.
I think that covers it, but I'm not certain.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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