[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: alternative udata checking
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 4 Dec 2011 16:41:08 -0200
> > Why would changing to array notation change the mergability of these
> > symbols? I have seen gcc guessing that a static array is constant
> > (without the const declaration) so it can optimize more (which I guess
> > also means removing duplicates).
>
> Ah, I didn't know that. Does it mean that the compiler will emit the same
> address to static variables in different modules? That's weird, but I guess
> allowed by the standard...
It is weird and wrong. As someone already mentioned, distinct variables
must have distinct addresses.
-- Roberto