NO

Author Topic: Anonymous union or struct inside another struct is rejected  (Read 3093 times)

mingodad

  • Guest
I'm trying to compile the dao scripting language http://daovm.net/ and I'm getting errors with anoymous unions and structures inside another structure, the code compiles fine with gcc.

A pellesc project is attached, also if I define WIN32 it complains about __int64.

union DQuadUByte { void *p; struct  { unsigned char a, b, c, d; }; }; //<-- ??????????????????????????? Here pellesc asks for a name

struct DaoAbsType
{
   DAO_DATA_COMMON

   short         tid; /* type id */
   uchar_t       attrib;
   uchar_t       ffitype; /* for DaoCLoader module */
   DString      *name; /* type name */
   DString      *fname; /* field name, or parameter name */
   DArray       *nested;
   DMap         *mapNames;
   DaoTypeBase  *typer; /* TYPER of the represented type: built-in or C types */
   union {
      DaoBase    *extra;
      DaoClass   *klass;
      DaoCData   *cdata;
      DaoAbsType *abtype;
   };  <-??????????????????????????? Here pellesc asks for a name
};

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Anonymous union or struct inside another struct is rejected
« Reply #1 on: March 17, 2010, 01:42:07 PM »
Enable both Microsoft and PellesC extensions with -Ze -Zx options.

May the source be with you

mingodad

  • Guest
Re: Anonymous union or struct inside another struct is rejected
« Reply #2 on: March 17, 2010, 07:15:40 PM »
That worked, thanks a lot !