[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Compound Literals

From: Dave Dodge
Subject: Re: [Tinycc-devel] Compound Literals
Date: Tue, 26 Sep 2006 09:22:26 -0400
User-agent: Mutt/1.4.2i

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(&((struct point){1,1}));
    foo(&((struct point){.X=1,.Y=1}));

                                                  -Dave Dodge

reply via email to

[Prev in Thread] Current Thread [Next in Thread]