Beginner's Guide
    First Steps
    Input & Output
    Basic Custom Types
    Diagnostics
    Standard Library
    Code Organization
    Powerful Custom Types
    Generic Programming
    Memory Management
    Software Design Basics

    Compiler WarningsCompiler WarningsWarnings

    • Error = program not compilable
    • Warning = program compilable, but there is a problematic piece of code that might lead to runtime bugs

    Important gcc/clang Options gcc/clang Options gcc Options

    Most Important Options Most Important

    -Wall Highly recommended. You should always use at least this. It doesn't really enable all warnings, but rather the most important ones that don't produce too much false positive noise.
    -Wpedantic Highly recommended. Issue all warnings demanded by strict ISO C++; reject compiler-specific extensions.
    -Wextra Highly recommended.
    -Werror Make all warnings into errors ⇒ any warning will terminate compilation.

    Recommended Set of Options Recommended Recommended

    -Wall -Wconversion -Wextra -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wformat=2 -Wimport -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wpacked -Wpedantic -Wpointer-arith -Wredundant-decls -Wshadow -Wstack-protector -Wstrict-null-sentinel -Wswitch-enum -Wundef -Wwrite-strings

    Might be very noisy!

    -Wdisabled-optimization -Wpadded -Wsign-conversion -Wsign-promo -Wstrict-aliasing=2 -Wstrict-overflow=5 -Wunused -Wunused-parameter