Compiling with -Wshadow causes warnings/errors
I am trying to use websocketpp in an application that is compiled with -Wshadow and -Werror. Compilation fails because -Wshadow triggers some warnings in websocketpp.
The latest commit on the master branch should compile cleanly (library + all examples) on llvm/clang and gcc with -Wshadow. I've also added -Wshadow to the list of warnings that the development test suite uses.
Let me know if this does not fix your issue.
Unfortunately I still have compilation errors after pulling the latest version of master branch. See my errors in the following file: http://minimaldiff.hu/zeppelin/shadow_errors.txt
Taking a look..
hrm.. the remaining cases are cases where a variable shadows a method. Clang and GCC 4.8+ do not emit a warning for this but it looks like GCC <=4.7 does.
Actually I am using GCC 4.8.2 with -Wall, -Werror and -Wshadow. You can see the full command line in the file I previously referenced
The changelog for GCC 4.8 claims that these cases should not trigger warnings, but I've confirmed that it isn't actually the case.I've pushed another update that also changes the cases where variables shadow functions. Can you confirm that this solves your warning issue?
It works like a charm now, thank you! :)