Re: Variably modified arrays

Discussion in 'C Programming' started by Shao Miller, Jan 24, 2013.

  1. Shao Miller

    Shao Miller Guest

    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
     
    Shao Miller, Jan 24, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Foo

    Variably modified struct/union and C99

    Foo, Oct 8, 2009, in forum: C Programming
    Replies:
    2
    Views:
    1,176
  2. Helmut Jarausch
    Replies:
    20
    Views:
    2,228
    Johannes Schaub (litb)
    Oct 22, 2009
  3. Poster Matt
    Replies:
    21
    Views:
    1,746
    Poster Matt
    Jun 16, 2010
  4. James Kuyper

    Re: Variably modified arrays

    James Kuyper, Jan 24, 2013, in forum: C Programming
    Replies:
    1
    Views:
    191
    Shao Miller
    Jan 24, 2013
  5. Andrey Tarasevich

    Re: Variably modified arrays

    Andrey Tarasevich, Jan 24, 2013, in forum: C Programming
    Replies:
    0
    Views:
    193
    Andrey Tarasevich
    Jan 24, 2013
Loading...

Share This Page