473,378 Members | 1,319 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

lvalues -> incomplete types

An lvalue is an expression with an object type or
an incomplete type other than void;53)
if an lvalue does not designate an object when
it is evaluated, the behavior is undefined.

When would one ever use an incomplete type
as an lvalue?

--
nethlek
Nov 14 '05 #1
7 1725
Mantorok Redgormor wrote:

An lvalue is an expression with an object type or
an incomplete type other than void;53)
if an lvalue does not designate an object when
it is evaluated, the behavior is undefined.

When would one ever use an incomplete type
as an lvalue?


An lvalue isn't how you use an expression.
An lvalue is a kind of expression.

x = y; /* Two lvalues */

--
pete
Nov 14 '05 #2
pete wrote:
Mantorok Redgormor wrote:

An lvalue is an expression with an object type or
an incomplete type other than void;53)
if an lvalue does not designate an object when
it is evaluated, the behavior is undefined.

When would one ever use an incomplete type
as an lvalue?


An lvalue isn't how you use an expression.
An lvalue is a kind of expression.

x = y; /* Two lvalues */


Which expressions have incomplete type (other than void) and don't
violate a constraint?

Jeremy.
Nov 14 '05 #3
Jeremy Yallop wrote:

pete wrote:
Mantorok Redgormor wrote:

An lvalue is an expression with an object type or
an incomplete type other than void;53)
if an lvalue does not designate an object when
it is evaluated, the behavior is undefined.

When would one ever use an incomplete type
as an lvalue?


An lvalue isn't how you use an expression.
An lvalue is a kind of expression.

x = y; /* Two lvalues */


Which expressions have incomplete type (other than void) and don't
violate a constraint?


/* BEGIN new.c */

#include <stdio.h>

extern int array[];

int main(void)
{
int x;

x = array[5000];
return 0;
}

/* END new.c */

--
pete
Nov 14 '05 #4
pete wrote:

Mantorok Redgormor wrote:

An lvalue is an expression with an object type or
an incomplete type other than void;53)
if an lvalue does not designate an object when
it is evaluated, the behavior is undefined.

When would one ever use an incomplete type
as an lvalue?


An lvalue isn't how you use an expression.
An lvalue is a kind of expression.

x = y; /* Two lvalues */

No. Only x might be an lvalue. y is an rvalue.
--
Joe Wright http://www.jw-wright.com
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 14 '05 #5
On Fri, 06 Feb 2004 23:49:28 GMT, Joe Wright
<jo********@earthlink.net> wrote in comp.lang.c:
pete wrote:

Mantorok Redgormor wrote:

An lvalue is an expression with an object type or
an incomplete type other than void;53)
if an lvalue does not designate an object when
it is evaluated, the behavior is undefined.

When would one ever use an incomplete type
as an lvalue?


An lvalue isn't how you use an expression.
An lvalue is a kind of expression.

x = y; /* Two lvalues */

No. Only x might be an lvalue. y is an rvalue.


Assuming y is the name of an object of a type that is assignment
convertible to the type of x, rather than a macro or enumerated
constant, than y in this expression is most certainly an lvalue.

The assignment statement performs "lvalue to value" conversion,
by accessing the value of the object. The result of this conversion
is a pure value, and no longer an lvalue, but that does not mean that
y itself is not an lvalue.

Note also that this used to be called "lvalue to rvalue" conversion,
but the term "rvalue" is no longer used in the current C standard
except for a footnote that this formerly used term has been replaced
by the phrase "value of an expression".

Here's the actual quote from 6.3.2.1 Lvalues, arrays, and function
designators, paragraph 2, of the current C standard:

"Except when it is the operand of the sizeof operator, the unary &
operator, the ++ operator, the -- operator, or the left operand of the
.. operator or an assignment operator, an lvalue that does not have
array type is converted to the value stored in the designated
object (and is no longer an lvalue). If the lvalue has qualified type,
the value has the unqualified version of the type of the lvalue;
otherwise, the value has the type of the lvalue. If the lvalue has an
incomplete type and does not have array type, the behavior is
undefined."

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #6
Jack Klein wrote:

On Fri, 06 Feb 2004 23:49:28 GMT, Joe Wright
<jo********@earthlink.net> wrote in comp.lang.c:
pete wrote:

Mantorok Redgormor wrote:
>
> An lvalue is an expression with an object type or
> an incomplete type other than void;53)
> if an lvalue does not designate an object when
> it is evaluated, the behavior is undefined.
>
> When would one ever use an incomplete type
> as an lvalue?

An lvalue isn't how you use an expression.
An lvalue is a kind of expression.

x = y; /* Two lvalues */

No. Only x might be an lvalue. y is an rvalue.


Assuming y is the name of an object of a type that is assignment
convertible to the type of x, rather than a macro or enumerated
constant, than y in this expression is most certainly an lvalue.

The assignment statement performs "lvalue to value" conversion,
by accessing the value of the object. The result of this conversion
is a pure value, and no longer an lvalue, but that does not mean that
y itself is not an lvalue.

Note also that this used to be called "lvalue to rvalue" conversion,
but the term "rvalue" is no longer used in the current C standard
except for a footnote that this formerly used term has been replaced
by the phrase "value of an expression".

Here's the actual quote from 6.3.2.1 Lvalues, arrays, and function
designators, paragraph 2, of the current C standard:

"Except when it is the operand of the sizeof operator, the unary &
operator, the ++ operator, the -- operator, or the left operand of the
. operator or an assignment operator, an lvalue that does not have
array type is converted to the value stored in the designated
object (and is no longer an lvalue). If the lvalue has qualified type,
the value has the unqualified version of the type of the lvalue;
otherwise, the value has the type of the lvalue. If the lvalue has an
incomplete type and does not have array type, the behavior is
undefined."

Ok Jack, thanks. Aren't standards wonderful? In the old days, "An object
is a manipulatable region of storage; an lvalue is an expression
referring to an object." Short and sweet. Thanks again.
--
Joe Wright http://www.jw-wright.com
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 14 '05 #7
Joe Wright wrote:
Ok Jack, thanks. Aren't standards wonderful?
In the old days, "An object
is a manipulatable region of storage; an lvalue is an expression
referring to an object." Short and sweet.


A dereferenced pointer to object type, is also an lvalue.
That's the kind of lvalue, which gives undefined behavior,
if it doesn't refer to an object when evaluated.
But, they've kept the word "dereferenced" out of the standard, so far.

--
pete
Nov 14 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stefan Slapeta | last post by:
Hi, please could anybody check if this defect is fixed in whidbey? struct X { X() {} X(X& x) {}
23
by: steve.j.donovan | last post by:
Hi guys, We have the following macro: #define NEXT(type,p) (*((type*)(p))++) It provides a way to poke variable sized data into an array of pcode for a simple VM. e.g,
3
by: ramasubramanian.rahul | last post by:
i was reading soemthing about Lvalues Rvalues and modifiable Lvalues.... i am confused now... like for eg int *y , x ; y = &x ; in the second is x a lvalue or rvalue any pointers on some good...
61
by: jacob navia | last post by:
Continuing the discussion about casts, I would like to know your opinions about the hairy subject of casts as lvalues, i.e. This will fail under lcc-win32, but MSVC and gcc will accept it. I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.