From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Eager To: Falk Hueffner Cc: gcc@gcc.gnu.org Subject: Re: Is this a gcc bug? Date: Wed, 17 Jan 2001 14:57:00 -0000 Message-id: <3A662214.9485A2A9@mvista.com> References: <20010113022149.AFA5534D80@nile.gnat.com> <3A64EDD6.76B11021@mvista.com> <87wvbubgol.fsf@student.uni-tuebingen.de> X-SW-Source: 2001-01/msg01097.html Falk Hueffner wrote: > > Michael Eager writes: > > > My sugguestion: > > > > undefined behavior: value of expression using 'x' is undefined > > This would seem to imply that the behaviour is undefined because one > uses an undefined value. But that's not the case: the standard says > program behaviour is undefined even if you say x = ++x and never look > at x again. (At least IIRC.) It is the result of the expression (including any side effects) which is undefined. An expression has a value, even if you never use it. There are many constructs with undefined behavior. Some can be recognized at compile time; most cannot. -- Michael Eager Senior Tools Developer Phone: (408) 328-8426 MontaVista Software, Inc. Fax: (408) 328-9204 1237 E. Arques Avenue Web: www.hardhatlinux.com Sunnyvale, CA 94085 Email: eager@mvista.com