I compiled a small gtkmm application with -Weffc++, and I got
warnings from code in the following packages: gtkmm, glibmm,
cairomm, libsigc++, glib. The best you can do is to either give up the use of -Weffc++, or make a filter that removes all warnings from the compiler listing except those from your own code. Kjell Den 2015-01-18 19:31, Jonas
Platte skrev:
There's a simple fix for that: Don't use -Weffc++. The C++ standard library g++ uses (I think it's called libstdc++) doesn't even pass without, or with only a few warnings when having that flag enabled. For example, it warns you about class members that are not explicitly initialized in each constructor of that class (which might make sense for pointers and maybe primitive types, but almost never for objects). If you want to get more warnings about possible problems than you get with "-Wall", use "-Wall -Wextra -pedantic". If you think your compiler could still detect more potential problems, the best thing to do IMHO is copy-pasting a list of warning flags from a list like this[1]. [1] http://stackoverflow.com/a/9862800/1592377 Am 18.01.2015 um 19:15 schrieb Frédéric Fort:Hello, I am trying to learn how to use gtkmm for some days now. Unfortunately, my compiler sends a lot of errors because of gtkmm, when I add warning flags. When compiling a minimalistic program (a Gtk::Main and an empty Gtk::Window) with the flag -Weffc++ alone, I get 221 warnings. Looking for problems in my source code becomes very difficult thus. Are there any solutions for this problem (except instantly writing perfect code and not needing warnings) or plans to reduce the amount of warnings sent during compilation ? |