C99 initializers in lcc-win

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top