In the following example, variable x is not detected as not used
Actually, warnings are only declared for built in types (bool, int, float, double, etc …). Compiler can’t determine if removing declaration of x would change the behaviour of semantics program.
If you found this post or this website helpful and would like to support our work, please consider making a donation. Thank you!Help Us
Articles in the same category
- Undefined Symbol ___gxx_personality_v0
- gcc /g++ Why some variables are not detected as not used during compilation?
- gcc / g++ preprocessor flags for the compiler version number
- gcc / g++ how to dump all preprocessor definitions
- gcc / g++ find where a header file is included from
- g++ compilation option -Weffc++
- Disable all gcc / g++ warnings
- Code that compiles with gcc but not g++
- Build in release mode with full optimizations in gcc / g++
- C++ - Faq C++ GCC G++