Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   Re: Variably modified arrays (http://www.velocityreviews.com/forums/t956893-re-variably-modified-arrays.html)

Shao Miller 01-24-2013 04:17 PM

Re: Variably modified arrays
 
On 1/24/2013 11:16, Russell Shaw wrote:
> Hi,
> In gcc-4.7 C99, this is accepted in a block scope:
>
> int n;
>
> struct tag {
> int (*y)[n]; // invalid: y not ordinary identifier
> int z[n]; // invalid: z not ordinary identifier
> };
>
> from 6.7.5.2 p10 example 4 WG14/N1336.
>
> 6.7.2.1 p8
> "A member of a structure or union may have any object type other than a
> variably modified type.(108)"
>
> Footnote 108:
> "A structure or union cannot contain a member with a variably modified
> type because member names are not ordinary identifiers as defined in
> 6.2.3."


A C implementation is permitted to allow extensions. You are invoking
GCC in a mode which is not strictly C99.

--
- Shao Miller
--
"Thank you for the kind words; those are the kind of words I like to hear.

Cheerily," -- Richard Harter


All times are GMT. The time now is 05:31 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.