lua-users home
lua-l archive

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

Florian Weimer wrote:
> I wonder what the correct semantics would be.  Error out on any
> redeclaration?  Or only if the redeclaration differs in a significant
> way?  (Which could boil down to graph isormorphism.)

C99 has strict rules for that. But most compilers use relaxed
rules. It can get a bit tricky, e.g. with incomplete structs or
function prototypes.

For the FFI one would want to use different rules in some places.
E.g. some users may (wrongly) redeclare intptr_t because they just
copied the CPP output for the wrong architecture. Maybe one should
ignore that redeclaration. OTOH, one ought to check for full
structural equivalence of function redeclarations. I haven't made
my mind up on the best semantics. Which is the main reason why I
haven't implemented it, yet.