On 10/12/21 10:31 PM, Akim Demaille wrote:
Well, maybe the problem is actually very simple: the sym_table pointer is not initialized to NULL by the compiler. And as a matter of fact, it is probably right, I don't believe the C standard requires it to do it. It is mandatory for static variables, but that's not the case here.
No, the variable has static storage duration, so it must be initialized to null (and this assumption is quite portable). In C, a top-level variable has static storage duration even if its not declared with the 'static' keyword (so long as it's not declared _Thread_local in recent C).