Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > C99 initializers in lcc-win

Reply
Thread Tools

C99 initializers in lcc-win

 
 
jacob navia
Guest
Posts: n/a
 
      09-03-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between "library parts" of C99 and "language parts" of C99 albert.neu@gmail.com C Programming 3 03-31-2007 08:14 PM
C99 struct initialization (C99/gcc) jilerner@yahoo.com C Programming 3 02-20-2006 04:41 AM
JNI Invocation: static UN-initializers? James Robert Leek Java 2 08-31-2004 09:13 PM
problem with static initializers j l Java 5 02-23-2004 09:58 PM
Class variable initializers Glen Able Java 0 01-29-2004 02:55 PM



Advertisments