[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A weird bug with luaL_Reg array
- From: Shmuel Zeigerman <shmuz@...>
- Date: Fri, 01 Jul 2022 10:39:58 +0300
On 01/07/2022 9:39, Sergey Zakharchenko wrote:
Your symbols are exported by default (which is likely contrary to your
Windows experience) and I would guess a collision between e.g. the
'methods' symbol in the library and the larger program (or a
neighbouring library); not really Lua-specific. Suggest renaming to
confirm.
I understand that there's a collision and that renaming 'methods' may
solve the problem.
However AFAIK C-files are compiled one-by-one and the argument 'methods' in
luaL_register(L, NULL, methods);
should have been resolved at compile time because the compiler sees its
definition above.
What I'd like to understand is why the real behavior is different and
how to prevent such troubles in the future.
So the 2 questions remain:
1. Whether the lack of the word 'static' is a bug here?
2. Does some GCC switch exist to prevent such behavior?
--
Shmuel