Dimensions of array parameters
Joseph S. Myers
joseph@codesourcery.com
Tue Dec 6 16:16:00 GMT 2011
On Tue, 6 Dec 2011, Ludovic Courtès wrote:
> > extern void foo (int a, int x[__attribute__ ((dim (a)))])
> >
> > could be implemented.
>
> Why use special syntax for this? It seems to me that int x[a] conveys
> the exact same information.
No, int x[static a] conveys that information - note the "static". The
intended use of that [static] is for optimization, but there could also be
an option to generate warnings or errors based on it instead.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc
mailing list