Hi,

I write a lot of code that emits code and it is a nuisance to try to
keep track of which index values have been initialized and which not.
This initialization extension would be really, really cool and if I
can find some of that mythical "copious spare time" I may provide
a patch:

   int foo[] = {
      [2] = 0,
      [4] = 1,
      [*] = -1
   };

This would be equivalent to:
   int foo[5] = { -1, -1, 0, -1, 1 };

Thank you!

Regards, Bruce

Also, a suggested doc tweak:

  sed 's/As in/Unlike/' --

5.18 Non-Constant Initializers
==============================

As in standard C++ and ISO C99, the elements of an aggregate
initializer for an automatic variable are not required to be constant
expressions in GNU C.  Here is an example of an initializer with
run-time varying elements:

     foo (float f, float g)
     {
       float beat_freqs[2] = { f-g, f+g };
       /* ... */
     }

Reply via email to