Subject: Re: slightly off topic: [*]
To: Alan Barrett <apb@cequrux.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-toolchain
Date: 09/23/2005 09:56:09
--s9fJI615cBHmzTOP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Sep 23, 2005 at 04:23:23PM +0200, Alan Barrett wrote:
> On Fri, 23 Sep 2005, Perry E. Metzger wrote:
>=20
> > Does this have any semantic distinction from the prototype saying
> >=20
> > int foo(int i, int a[]);
> >=20
> > at all? Compiled code has no way of knowing what the main function
> > might have inside the [] anyway, so it can't behave differently.
>=20
> For one-dimensional arrays, it makes no real difference in the caller.
> In the function itself, the compiler could be stricter about subscript
> range checking if the function is defined with
>=20
> 	int foo(int i, int a[i]);
>=20
> rather than
>=20
> 	int foo(int i, int a[]);
>=20
> or
>=20
> 	int foo(int i, int *a);
>=20
> For multi-dimensional arrays, you get syntax errors with "int a[][]",
> and "int **a" is semantically different from a two-dimensional array.

Cool! Finally C can deal with Fortran-style multidimensional arrays (if I=
=20
understand that right).

Take care,

Bill

--s9fJI615cBHmzTOP
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFDNDOpWz+3JHUci9cRAvTgAJ90/2eCdrZNqLfwhqHe9TQUDTb58ACfc3NR
MfuCsGbsb8g2rddAXuHiSl8=
=/r1C
-----END PGP SIGNATURE-----

--s9fJI615cBHmzTOP--