-
Notifications
You must be signed in to change notification settings - Fork 104
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
questionable casts and other warnings #138
Comments
You should add -Wunused-variable to this list, among others I can't remember (not sitting at a terminal at the moment). I do know, however, I cannot compile when using -Werror; which is a standard flag for many of the projects I work on personally and at work. I had seriously considered fixing many of these on my fork, but I haven't had the time to spare. |
I just listet those, for which I saw some errors. Below is the full list I typically use for the gcc. It is very well possible to write code that produces no warnings with all of these flags, so I don't see a reason not to do so ;) (-Wunused-variable is included in -Wall) -Wall -Wextra -pedantic -Wundef -Wunreachable-code -Wdisabled-optimization -Wcast-qual -Wsign-promo -Winit-self -Wnon-virtual-dtor -Woverloaded-virtual -Wconversion -Wfloat-equal -Wshadow -Wswitch-default -Wpacked -Wcast-align -Wold-style-cast -Wuseless-cast -Wlogical-op -Wtrampolines -Wnoexcept |
|
I do use boost and don't get any warnings. And everything I have described might not be a problem (yet), but some of them are mistakes. Even if you do have to handle some GiB of data such that the cast from unsigned long (std::size_t) to int is ever a problem... |
@BenHuber I see. Such casts are definitely questionable. So yeah, we should go over the code base and fix these things .. |
Using autobahn with the compiler flags that I typically use leads to a large list of errors. Among them are
This seems to conflict with the otherwise well written modern c++ code, so I think it should be fixed (as many of these warnings can indicate mistakes or bugs).
The text was updated successfully, but these errors were encountered: