Voids in a comma expression

Doug Gwyn gwyn at smoke.brl.mil
Sat Jun 22 14:46:11 AEST 1991


In article <34405 at shamash.cdc.com> paul at u02.svl.cdc.com (Paul Kohlmiller) writes:
>extern void foo(int x);
>main() {
>int j=3;
>int i;
>j=(i=4,foo(i),i++);
>}
>The diagnostic claims that ANSI disallows the void expression foo(i) in the
>command expression.

Well, the compiler is wrong.  The only thing wrong with the code example,
its failure to return a value from main(), has nothing to do with its use
of the comma operator.

The rest of your question I found totally confusing.  Perhaps you should
not let a buggy compiler influence your understanding of the language.



More information about the Comp.std.c mailing list