C99 initializers in lcc-win

Discussion in 'C Programming' started by jacob navia, Sep 3, 2008.

  1. jacob navia

    jacob navia Guest

    One of the last features lcc-win was missing from the C99 definition was
    designator initializers.

    When initializing an array, the C99 standard mandates that for
    arrays you can write

    int array[] = {[12]=1234};

    This will produce an array of 13 elements with the last one (the 13th)
    initialized to 1234.

    For structures you can write:
    struct Example { int a,b,c;};
    struct Example E = {.c = 3,.a=1};

    wil produce the equivalent of
    struct Example E = {1,0,3};

    This required a full rewrite of the compiler's init code.
    I have been testing this for quite a while, but I can't
    be 100% sure that it works. If you notice any problems
    please do not hesitate to contact me.

    --
    jacob navia
    jacob at jacob point remcomp point fr
    logiciels/informatique
    http://www.cs.virginia.edu/~lcc-win32
     
    jacob navia, Sep 3, 2008
    #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. jacob navia

    Warnings in lcc-win

    jacob navia, Sep 27, 2007, in forum: C Programming
    Replies:
    70
    Views:
    1,761
    Charlie Gordon
    Oct 3, 2007
  2. jacob navia

    ANN Linux version of lcc-win

    jacob navia, Oct 5, 2007, in forum: C Programming
    Replies:
    1
    Views:
    377
    Keith Thompson
    Oct 5, 2007
  3. jacob navia

    lcc-win and windows 98

    jacob navia, Jan 21, 2008, in forum: C Programming
    Replies:
    16
    Views:
    558
    santosh
    Jan 24, 2008
  4. Eddie

    Bug/problem with lcc-win

    Eddie, Jun 3, 2008, in forum: C Programming
    Replies:
    69
    Views:
    1,380
    Richard
    Jun 14, 2008
  5. Krist
    Replies:
    6
    Views:
    786
    Arne Vajhøj
    May 7, 2010
Loading...

Share This Page