From 6b8ad8489b51c4b71edd197c4924fe140292206c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 16 May 2014 09:59:03 +0000 Subject: [PATCH] Work around bogus "use of possibly uninitialized variable" warning. Resolution::m_x and m_y were always initialized before use but g++ 4.2 still complained about them being possibly not initialized, so do initialize them. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/imagbmp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 401e83d606..adbe3bb908 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -1101,6 +1101,12 @@ bool wxBMPHandler::LoadDib(wxImage *image, wxInputStream& stream, Resolution() { m_valid = false; + + // Still initialize them as some compilers are smart enough to + // give "use of possibly uninitialized variable" for them (but not + // smart enough to see that this is not really the case). + m_x = + m_y = 0; } void Init(int x, int y)