3 ms·
Sadly, g++ v4.7.3 on Ubuntu 13.04 does not give any warnings on that code by default.
by ansible 13y ago
Sadly, g++ v4.7.3 on Ubuntu 13.04 does not give any warnings on that code by default.
- kllrnohj 13y agoso step 1 of teaching C++ is "how to compile 101" where the lesson consists entirely of "g++ -wall -werror <file.cpp>"
- ansible 13y agoso step 1 of teaching C++ is "how to compile 101" where the lesson consists entirely of "g++ -wall -werror <file.cpp>" I can't argue with that. I'd also teach students right from the start to look at the intermediate files as one of the early steps to understanding compile problems (so with gcc that would be the '-save-temps' option).
- okey 13y agoThat is genuinely a significant chunk of the first lesson I ever had on C++. Near-essential compiler options (and why) were followed by Hello World, rather than the other way around.
- CUViper 13y agoIt's picked up by -Wsign-compare, which is included in -Wall for C++, or -Wextra for C. I'm curious whether CL does warn on this by default, or if MSVC's default just includes similar warning flags.
- bcoates 13y agoLooks like Visual Studio's default project setting is -W3 but cl itself has a bunch of crazy historical defaults like -W1 and C++ exception stack unwind disabled (wtf?)