Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warnings #3

Open
mcandre opened this issue Dec 24, 2018 · 1 comment
Open

Compiler warnings #3

mcandre opened this issue Dec 24, 2018 · 1 comment

Comments

@mcandre
Copy link

mcandre commented Dec 24, 2018

Clang appears to emit some warnings about the flower source code:

$ cmake .
$ make
...
[ 31%] Linking CXX static library libflower_switchboard_lib.a
[ 31%] Built target flower_switchboard_lib
Scanning dependencies of target gtest_main
[ 34%] Building CXX object contrib/googletest-release-1.8.0/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 36%] Linking CXX static library libgtest_main.a
[ 36%] Built target gtest_main
Scanning dependencies of target flower_unittests
[ 38%] Building CXX object CMakeFiles/flower_unittests.dir/flower/switchboard/handle_test.cc.o
In file included from /flower/flower/switchboard/handle_test.cc:18:0:
/flower/flower/switchboard/worker_pool.h:19:7: warning: 'flower::switchboard::WorkerPool' has a field 'flower::switchboard::WorkerPool::logger_' whose type uses the anonymous namespace [-Wsubobject-linkage]
 class WorkerPool {
       ^~~~~~~~~~

Using Clang v4.0, on Ubuntu Bionic Beaver.

@EdSchouten
Copy link
Member

I suspect that we need to do something like this:

diff --git a/flower/util/logger.h b/flower/util/logger.h
index ac153f7..15bc75f 100644
--- a/flower/util/logger.h
+++ b/flower/util/logger.h
@@ -13,7 +13,6 @@
 
 namespace flower {
 namespace util {
-namespace {
 
 // Log entry that is in the process of being written. This class
 // serializes output to the stream and also ensures all entries have a
@@ -51,7 +50,6 @@ class Logger {
   std::streambuf* streambuf_;
 };
 
-}  // namespace
 }  // namespace util
 }  // namespace flower
 

Can you confirm that this fixed the warning you're seeing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants