Warning emitted by the compiler, but does not prevent program execution. A compile error does prevent program execution.
- 'auto' will change meaning in C++0x; please remove it
- Cannot create pre-compiled header: initialized data in header
- left shift count >= width of type
- lexical_cast.hpp: Negating unsigned value
- Object::connect: No such slot QDialog::my_slot()
- type qualifiers ignored on function return type
- unused parameter 'seq'
How to add extra warnings in Qt Creator?
In the project file, add the following line:
QMAKE_CXXFLAGS += -Wextra
How to add the compile warnings of 'Effective C++' by Scott Meyers in Qt Creator?
In the project file, add the following line:
QMAKE_CXXFLAGS += -Weffc++
How to let compile warnings be treated like compile errors in Qt Creator?
In the project file, add the following line:
QMAKE_CXXFLAGS += -Werror
- Compile cleanly at high warning levels [1,3]
- Prefer compile errors to runtime errors [2,4]
- [1] Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 1: 'Compile cleanly at high warning levels'.
- [2] Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 14: 'Prefer compile- and link-time errors to run-time errors'.
- [3] Linus Torvalds. Re:[PATCH] Don't compare unsigned variable for <0 in sys_prctl(). 2006-11-28. Retrieved on 2010-09-20. 'Friends don't let friends use [gcc] "-W"'
- [4] C++ Core Guidelines: P.5: Prefer compile-time checking to run-time checking