This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A simple question on expression


On Fri, Aug 31, 2001 at 05:00:33PM +0800, Jie Zhang wrote:

> your "obvious" explanation is not satisfiable.
> why a = 0?0:a++; not be expanded to if (0) a=0; else a=a++; /* 2 */
It IS expanded, however, since the expression is undefined, nobody
will guarantee that it will be equal in different code parts..

moreover, you'll discover that
if(a<4)
	a=0;
else
	a++;

would result in a == 6 ..

[Or, it may differ for your architecture/compiler/anything else]

-- 
"It is easier to fight for principles than to live up to them."
-- Alfred Adler


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]