Ah. Yes. You are correct. I did check, and inside functions, its working fine. 
So this is effectively a bug with compound literals, but only in the global 
scope....

Which is naturally where I use them the most, of course. ;)

I will look at tcc code. It's probably beyond my ability to fix. But never 
hurts to try.

Andrew

>From: Dave Dodge <[EMAIL PROTECTED]>
>Sent: Sep 26, 2006 9:22 AM
>To: Andrew Johnson <[EMAIL PROTECTED]>, [email protected]
>Subject: Re: [Tinycc-devel] Compound Literals
>
>On Tue, Sep 26, 2006 at 12:33:28AM -0400, Andrew Johnson wrote:
>> struct point { int X; int Y; } *test = &((struct point){1, 1});
>> 
>> Is this a bug in compound literals support, or does tcc currently
>> not support them at all?
>
>I'm guessing you're defining them outside a function.  It seems to
>have a problem with that.  It does appear to support them within
>functions, with or without designated initializers.  For example:
>
>  extern void foo(struct point *);
>
>  void bar(void)
>  {
>    struct point * pp = &((struct point){1,1});
>    foo(pp);
>    foo(&((struct point){1,1}));
>    foo(&((struct point){.X=1,.Y=1}));
>  }
>


_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to