lua-users home
lua-l archive

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


> [Lua 4.0/4.0.1]  I didn't check if this is ANSI C/C++ or not, but Borland
> C++ Builder 4.0 generates an error on the different declaration and
> definition in lcode.h/lcode.c (the missing/additional NUM_OPCODES size
> specifier):
>
> lcode.h, 41:  extern const struct OpProperties {...} luaK_opproperties[];
>
> lcode.c, 650:  const struct OpProperties luaK_opproperties[NUM_OPCODES] =
> {...};

At least in C++ the types of luaK_opproperties do not match.  The "multiple
declaration" error seems reasonable...  The ISO C++ document states:
[section dcl.array]

  If the constant  expression  is
  omitted,  the type of the identifier of D is "derived-declarator-type-
  list array of unknown bound of T," an  incomplete  object  type.   The
  type  "derived-declarator-type-list  array of N T" is a different type
  from the type "derived-declarator-type-list array of unknown bound  of
  T,"

I don't have ISO C90 documentation, so I'm not sure how it handles this.

Bye,
Wim