Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Dec 2000 14:55:44 -0800
From:      "David O'Brien" <obrien@freebsd.org>
To:        Mike Smith <msmith@freebsd.org>
Cc:        alpha@freebsd.org
Subject:   Re: cvs commit: src/sys/alpha/conf GENERIC
Message-ID:  <20001208145543.A46079@dragon.nuxi.com>
In-Reply-To: <200012082109.eB8L9vF02129@mass.osd.bsdi.com>; from msmith@freebsd.org on Fri, Dec 08, 2000 at 01:09:57PM -0800
References:  <20001208205603.C401D37B404@hub.freebsd.org> <200012082109.eB8L9vF02129@mass.osd.bsdi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 08, 2000 at 01:09:57PM -0800, Mike Smith wrote:
> > How is this not a syntax error?
> 
> Because there's a comma between the two statements.
> 
> 	i = 10, j = malloc(i);
> 
> is a legal expression which returns 10.  The comma operator really only 
> exists for things like

Almost -- acutally the value of the expression is `malloc(i)'.

ISO/IEC 9899:1999(E)
6.5.17 Comma operator
Semantics:
The left operand of a comma operator is evaluated as a void expression;
thre is a sequence point after its evaluation.  The the right operand is
evaluated; the result has its type and value.[94]


[94] A comma operator does not yeild an lvalue.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001208145543.A46079>