Uninitialized static consts
Andrew Talbot
Andrew.Talbot at talbotville.com
Fri Dec 28 10:14:39 CST 2007
Samuel Lidén Borell wrote:
> Hi,
>
> I discovered a static constant wasn't initialized in RedrawWindow when I
> was using Valgrind. I wonder if this is a problem or not, because it has
> been there since 2005 and it doesn't give any compiler warnings. AFAIK
> constants can't be initialized later (unless they are pointers), so it
> seems to me that this really is a problem.
>
> I used a regex to find other occurrences of uninitialized consts, and I
> found a lot of them. Most of them are interfaces, but I don't know what
> interfaces *really* are, so I don't know about these. But types like
> structs and unions should be initialized, right?
>
Hi Samuel,
Objects with static duration, if not specifically initialized, are given
implicit initializers: their elements are zeroed.
Regards,
--
Andy.
More information about the wine-devel
mailing list