Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!ima!haddock!karl From: karl@haddock.UUCP Newsgroups: comp.lang.c Subject: Re: Trouble with arrays Message-ID: <523@haddock.UUCP> Date: Mon, 8-Jun-87 22:24:37 EDT Article-I.D.: haddock.523 Posted: Mon Jun 8 22:24:37 1987 Date-Received: Fri, 12-Jun-87 01:13:46 EDT References: <40@gt-eedsp.UUCP> <5898@brl-smoke.ARPA> Reply-To: karl@haddock.ISC.COM.UUCP (Karl Heuer) Distribution: na Organization: Interactive Systems, Boston Lines: 32 In article <5898@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >Because of this characteristic, the formal parameter in the function, which >(unfortunately) Dennis decided to allow one to write as though it were the >actual array declaration, is converted to a pointer to the first element ... I agree that this is unfortunate. >If I were designing C ... I would require the first of the two equivalent >forms I just gave as the only correct formal parameter declaration (modulo >extra grouping parentheses), instead of supporting the "convenient" syntactic >sugar that permits your original example. However, we're now stuck with the >decision, ... Are we? I propose that array declarations as formal parameters should be ILLEGAL in a function prototype. This is fully compatible with oldC, which doesn't have prototypes. This is the perfect time to make this change -- if false arrays are allowed in this standard, it will be very difficult to remove them later. This will not only reduce the confusion, but it may make it possible to introduce array copy (call by value, return by value, and assignment) in some future release of the standard. (I have some ideas on this; details on request.) ***** * \ * Say NO to false-array formal arguments in prototypes! * \ * Say YES to arrays as real objects! *f(int[]);* * \ * Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), * \ * The Walking Lint *****