[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: alternative udata checking
- From: Sam Roberts <vieuxtech@...>
- Date: Fri, 2 Dec 2011 20:19:06 -0800
On Fri, Dec 2, 2011 at 6:08 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> 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...
What about if it wasn't static.. only the linker could know another
module wasn't using it, I'd think, and I doubt it would
be smart enough to know. Or, you could strcpy the value in during the
init, maybe.
Cheers,
Sam