Article View: comp.std.c
Article #3172Re: Voids in a comma expression
From: Doug Gwyn
Date: Sat, 22 Jun 1991 04:46
Date: Sat, 22 Jun 1991 04:46
16 lines
1018 bytes
1018 bytes
In article <34405@shamash.cdc.com> paul@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.
Technical Details
Message-ID:
<16482@smoke.brl.mil>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ncar!hsdndev!cmcl2!adm!smoke!gwynReferences:
<34405@shamash.cdc.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ncar!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: Voids in a comma expression Keywords: voids comma operator Message-ID: <16482@smoke.brl.mil> Date: 22 Jun 91 04:46:11 GMT References: <34405@shamash.cdc.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 16