[Top][All Lists]

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

Re: [Tinycc-devel] struct initializer bug

From: Mark
Subject: Re: [Tinycc-devel] struct initializer bug
Date: Fri, 23 Feb 2007 08:54:05 -0600

----- Original Message ----- From: "Dave Dodge" <address@hidden>
To: <address@hidden>
Sent: Friday, February 23, 2007 7:12 AM
Subject: [Tinycc-devel] struct initializer bug

I have some recent code that uses a lot of elaborate initializers, and
more than one file triggered this error.  It says "field expected" for
the line containing the .v initializer in the second structure,
perhaps as if it doesn't think that the .p initializer is finished.  I
only briefly glanced at the compiler and it looks like it's got to be
in decl_designator() since that's the only function that produces this
error message.  Minor changes, such as removing the "y" field from
struct point, or removing the ".v" initializer, make the error go

                                                 -Dave Dodge

struct point{
       int x,y;

struct obj{
       struct point p;
       int v;

void foo(void)
       /* this works */
       struct obj zz1 = {
               .p = (struct point){ .x = 0 },
               .v = 0

Because of a different type declaration.

       /* this does not */
       struct point p = { .x = 0 };
       struct obj zz2 = {
               .p = p,
               .v = 0
Because of structuring a point (pointer) is not allowed in ANSI C#

Tinycc-devel mailing list

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.3/697 - Release Date: 2/22/2007 11:55 AM

reply via email to

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