Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • VLA/VM bug fixes for C

    6 answers - 329 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Mon, 8 May 2006, Mike Stump wrote:
    May 6, 2006, at 3:32 PM, Joseph S. Myers wrote:
    Function prototype scope is defined in 6.2.1#4.
    I've fixed up most all the previously identified issues
    In gnu99:
    void foo11(typeof (int (*)(int o[*])) i);
    valid?
    I think that's valid gnu99.
  • No.1 | | 258 bytes | |

    May 6, 2006, at 3:32 PM, Joseph S. Myers wrote:
    Function prototype scope is defined in 6.2.1#4.
    I've fixed up most all the previously identified issues
    In gnu99:
    void foo11(typeof (int (*)(int o[*])) i);
    valid?
  • No.2 | | 306 bytes | |

    May 8, 2006, at 2:30 PM, Joseph S. Myers wrote:
    >void foo11(typeof (int (*)(int o[*])) i);
    >

    I think that's valid gnu99.

    Speaking of typeof, should typeof (vla) follow the same rules as for
    sizeof (vla)? vla, evaluate, otherwise, no eval.
  • No.3 | | 563 bytes | |

    Wed, 10 May 2006, Mike Stump wrote:

    May 8, 2006, at 2:30 PM, Joseph S. Myers wrote:
    void foo11(typeof (int (*)(int o[*])) i);

    I think that's valid gnu99.

    Speaking of typeof, should typeof (vla) follow the same rules as for sizeof
    (vla)? vla, evaluate, otherwise, no eval.

    typeof should evaluate its argument iff variably modified. Thus typeof
    should evaluate a pointer to VLA argument, whereas sizeof only evaluates
    VLAs themselves. That's the conclusion I arrived at and put in a comment
    in gnu99-static-1.c.
  • No.4 | | 240 bytes | |

    Mike Stump <mrs (AT) apple (DOT) comwrites:
    Speaking of typeof, should typeof (vla) follow the same rules as for
    sizeof (vla)? vla, evaluate, otherwise, no eval.
    How would typeof be able to eval anything?
    Andreas.
  • No.5 | | 698 bytes | |

    Wed, 10 May 2006, Andreas Schwab wrote:

    Mike Stump <mrs (AT) apple (DOT) comwrites:

    Speaking of typeof, should typeof (vla) follow the same rules as for
    sizeof (vla)? vla, evaluate, otherwise, no eval.

    How would typeof be able to eval anything?

    If you have "typeof ((int (*)[f()])g())", clearly you need to evaluate the
    call f() in order to know the type being referred to. As such, I think
    the logical conclusion is to evaluate the argument of typeof whenever of
    VM type (and so evaluate the call g() as well).

    With VLAs, type names (in declarations, sizeof, typeof, casts and compound
    literals) can need to be executed for their side-effects.
  • No.6 | | 888 bytes | |

    "Joseph S. Myers" <joseph (AT) codesourcery (DOT) comwrites:

    | Wed, 10 May 2006, Andreas Schwab wrote:
    |
    | Mike Stump <mrs (AT) apple (DOT) comwrites:
    |
    | Speaking of typeof, should typeof (vla) follow the same rules as for
    | sizeof (vla)? vla, evaluate, otherwise, no eval.
    |
    | How would typeof be able to eval anything?
    |
    | If you have "typeof ((int (*)[f()])g())", clearly you need to evaluate the
    | call f() in order to know the type being referred to. As such, I think
    | the logical conclusion is to evaluate the argument of typeof whenever of
    | VM type (and so evaluate the call g() as well).
    |
    | With VLAs, type names (in declarations, sizeof, typeof, casts and compound
    | literals) can need to be executed for their side-effects.

    well, people may just switch to DML :-)
    C used to be simple.
    -- Gaby

Re: VLA/VM bug fixes for C


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 0 =
QUESTION ON "Development"

EMSDN.COM