From: Simon J. J. <sj...@er...> - 2003-11-11 15:19:47
|
I'm using log4cpp with BoostThreads under linux, cygwin and native win32 (after manually hacking the configuration files). However, I get large numbers of "getThreadId function defined but not used" warnings when compiling with gcc because the function body is declared in the header file. Following the pattern from PThreads and OmniThreads, would it be possible to move the function body into a new source file? I have done the following, which works on all of my target platforms: 1. In threading/BoostThreads.hh remove the function body and only leave the declaration: std::string getThreadId(); 2. Create a new file (e.g., BoostThreads.cpp) with the contents: #include <log4cpp/threading/Threading.hh> #if defined(LOG4CPP_HAVE_THREADING) && defined(LOG4CPP_USE_BOOSTTHREADS) namespace log4cpp { namespace threading { std::string getThreadId() { return std::string("not implemented"); }; } } #endif // LOG4CPP_HAVE_THREADING && LOG4CPP_USE_BOOSTTHREADS Cheers, Simon P. S. I had originally posted this on the patches list on sourceforge but it looks like that list hasn't been touched for over a year. Is that correct? |