From 8793514e030bb826aaad33210366910175e2a469 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 11 Mar 2009 13:57:05 +0000 Subject: [PATCH] work around some (harmless) g++ warnings about possibly uninitalized variables git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/event.cpp | 8 +++++++- src/html/m_tables.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/event.cpp b/src/common/event.cpp index 461b6fe5e7..2a4ff7954e 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1394,9 +1394,15 @@ bool wxEvtHandler::SafelyProcessEvent(wxEvent& event) } catch ( ... ) { - wxEventLoopBase *loop = wxEventLoopBase::GetActive(); + // notice that we do it in 2 steps to avoid warnings about possibly + // uninitialized loop variable from some versions of g++ which are not + // smart enough to figure out that GetActive() doesn't throw and so + // that loop will always be initialized + wxEventLoopBase *loop = NULL; try { + loop = wxEventLoopBase::GetActive(); + if ( !wxTheApp || !wxTheApp->OnExceptionInMainLoop() ) { if ( loop ) diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp index b111abed67..d1971d0fb1 100644 --- a/src/html/m_tables.cpp +++ b/src/html/m_tables.cpp @@ -769,7 +769,7 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH") m_WParser->OpenContainer(); // the header should be rendered in bold by default - int boldOld wxDUMMY_INITIALIZE(0); + int boldOld = 0; if ( isHeader ) { boldOld = m_WParser->GetFontBold(); -- 2.45.2