https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83859

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Yes,'void f (int[static 2])' does mean that and I had hoped to be able to rely
on it.  Unfortunately, the VLA specification suffers from a number of
limitations that made it impractical.  Some of them are discussed in WG14
N2074: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2074.htm.  Using an
attribute (either explicitly specified by the programmer or implicitly inserted
by GCC) would overcome some of these.  Another limitation, one that's not
discussed in N2074 but that's relevant to GCC, is that the VLA syntax is
available only in C and not in C++.  I'd like the feature to be usable in both
languages.

But even in C it's common to use 'void f (int[2])' to mean essentially the same
thing as 'void f (int[static 2])'.  It would be helpful if GCC could provide a
mechanism to help detect bugs when using the former, and I'm hoping to use the
attributes to do that.

Reply via email to