J
jacob navia
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.
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.