Skip to content
New issue

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

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

Already on GitHub? # to your account

Compiling with -Wshadow causes warnings/errors #318

Closed
giszo opened this issue Jan 29, 2014 · 7 comments
Closed

Compiling with -Wshadow causes warnings/errors #318

giszo opened this issue Jan 29, 2014 · 7 comments

Comments

@giszo
Copy link

giszo commented Jan 29, 2014

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.

@zaphoyd
Copy link
Owner

zaphoyd commented Feb 2, 2014

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.

@giszo
Copy link
Author

giszo commented Feb 2, 2014

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

@zaphoyd
Copy link
Owner

zaphoyd commented Feb 2, 2014

Taking a look..

@zaphoyd
Copy link
Owner

zaphoyd commented Feb 2, 2014

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.

@giszo
Copy link
Author

giszo commented Feb 2, 2014

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

@zaphoyd
Copy link
Owner

zaphoyd commented Feb 2, 2014

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?

@giszo
Copy link
Author

giszo commented Feb 2, 2014

It works like a charm now, thank you! :)

@zaphoyd zaphoyd closed this as completed Feb 2, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants