Re: Writing a C Compiler: lvalues

Eric Sosman <esosman@ieee.org>
Mon, 17 May 2010 09:00:28 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Writing a C Compiler: lvalues bartc@freeuk.com (bart.c) (2010-05-09)
Re: Writing a C Compiler: lvalues tom@iahu.ca (Tom St Denis) (2010-05-09)
Re: Writing a C Compiler: lvalues kst-u@mib.org (Keith Thompson) (2010-05-09)
Re: Writing a C Compiler: lvalues esosman@ieee.org (Eric Sosman) (2010-05-09)
Re: Writing a C Compiler: lvalues stargazer3p14@gmail.com (Stargazer) (2010-05-10)
Re: Writing a C Compiler: lvalues marc@lithia.nl (Marc van Lieshout) (2010-05-16)
Re: Writing a C Compiler: lvalues esosman@ieee.org (Eric Sosman) (2010-05-17)
Re: Writing a C Compiler: lvalues kst-u@mib.org (Keith Thompson) (2010-05-17)
Re: Writing a C Compiler: lvalues kst-u@mib.org (Keith Thompson) (2010-05-19)
Re: Writing a C Compiler: lvalues bartc@freeuk.com (bart.c) (2010-05-19)
Re: Writing a C Compiler: lvalues lawrence.jones@siemens.com (2010-05-19)
Re: Writing a C Compiler: lvalues kst-u@mib.org (Keith Thompson) (2010-05-19)
Re: Writing a C Compiler: lvalues DrDiettrich1@aol.com (Hans-Peter Diettrich) (2010-05-20)
[2 later articles]
| List of all articles for this month |

From: Eric Sosman <esosman@ieee.org>
Newsgroups: comp.lang.c,comp.compilers
Date: Mon, 17 May 2010 09:00:28 -0400
Organization: A noiseless patient Spider
References: 10-05-036 10-05-095
Keywords: C, parse
Posted-Date: 19 May 2010 00:33:28 EDT

On 5/16/2010 4:20 PM, Marc van Lieshout wrote:
>
> An lvalue is an expression that evaluates to an address, so it *can* be
> used on the left hand side of an assignment.


          That won't quite do. Here are two counter-examples, one an
expression that evaluates to an address but is not an lvalue:


malloc(42)


... and one an lvalue that cannot possibly involve an address:


register int x;
x = 42;


An lvalue (we're talking C here, right?) "is an expression with an
object type or an incomplete type other than void" (6.3.2.1p1).


--
Eric Sosman
esosman@ieee.org



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.