Article View: comp.std.c
Article #3617Re: Wishful thinking: return-parameter
From: Markus Freericks
Date: Wed, 02 Aug 1995 14:22
Date: Wed, 02 Aug 1995 14:22
25 lines
1488 bytes
1488 bytes
In article <1995Aug2.015211.11775@dcs.warwick.ac.uk> A.Main@dcs.warwick.ac.uk (Zefram) writes:
[..]
> I'm afraid it does. I think that
>
> int main()
> {
> int x = 0, y;
> (x,y) = 3;
> return 0;
> }
>
> is a strictly conforming program, having the effect of assigning the
> value 3 to y. Not having a copy of the standard, I'm not absolutely
[..]
hmm, gcc -ansi -pedantic -Wall (version 2.6.3) gives me a warning
m.c:4: warning: ANSI C forbids use of compound expressions as lvalues
so I assume existing code that does this is technically broken. No idea
whether anybody uses such code. If multiple-value-assignment would only be
allowed to capture the results of a mutliple-value-returning function of
the matching arity, there would be no problems with existing code.
-- Markus
Technical Details
Message-ID:
<3vnu6u$2rm@news.cs.tu-berlin.de>Path:
arc1-ca.pugleaf.net!cs.tu-berlin.de!mfxReferences:
<3ver2u$8bk@caip.rutgers.edu> <3vhf7k$lo8@mujibur.inmind.com> <DCL2LC.GBK@proteon.com> <3viv5u$bkv@news.cs.tu-berlin.de> <1995Aug2.015211.11775@dcs.warwick.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!cs.tu-berlin.de!mfx From: mfx@cs.tu-berlin.de (Markus Freericks) Newsgroups: comp.std.c Subject: Re: Wishful thinking: return-parameter Date: 02 Aug 1995 14:22:34 GMT Organization: TU Berlin Fachbereich Informatik Message-ID: <3vnu6u$2rm@news.cs.tu-berlin.de> References: <3ver2u$8bk@caip.rutgers.edu> <3vhf7k$lo8@mujibur.inmind.com> <DCL2LC.GBK@proteon.com> <3viv5u$bkv@news.cs.tu-berlin.de> <1995Aug2.015211.11775@dcs.warwick.ac.uk> NNTP-Posting-Host: lenin.cs.tu-berlin.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In-reply-to: A.Main@dcs.warwick.ac.uk's message of 02 Aug 1995 02:52:11 MET