Boost logo

Boost Users :

Subject: [Boost-users] [thread] Getting this warning message with optimization turn on
From: Shiou Ming Lee (shiouming.lee_at_[hidden])
Date: 2009-12-29 03:40:34

Hi, I'm building my program that depends on Boost.thread, but getting
following warning message, only when compiler's optimization been turn on.

    C:/boost_1_41_0/boost/thread/win32/thread_heap_alloc.hpp: In member
function `bool gUtil::GLog::LogWriterManager::startAsyncLogging(unsigned
    C:/boost_1_41_0/boost/thread/win32/thread_heap_alloc.hpp:156: warning:
'heap_memory' might be used uninitialized in this function

In the mentioned function, startAsyncLogging(unsigned int), there's only one
line of code that involves Boost.thread:

    // loggingThread is class LogWriterManager's member, of boost::thread
    loggingThread =
boost::thread(boost::bind(&LogWriterManager::loggingThreadFunc, this));

This happens for MinGW 3.4 on Windows Vista SP1 32-bits, but not for GCC 4.4
on Fedora 11 x86. The Boost release is of version 1.41.0.

Any idea what should I do for this warning message? Or should I just leave
optimization on and ignore this message?

Thanks & Regards
Shiou Ming

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at