Skip to content

Instantly share code, notes, and snippets.

@zvr
Created October 6, 2017 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zvr/d0427dc9aeb10ae85aea65bc8949af37 to your computer and use it in GitHub Desktop.
Save zvr/d0427dc9aeb10ae85aea65bc8949af37 to your computer and use it in GitHub Desktop.
gcc 7 with useful warnings (only for C)
#!/bin/sh
gcc \
-Wabi \
-Waddress \
-Walloc-zero \
-Walloca \
-Warray-bounds=2 \
-Wbad-function-cast \
-Wbool-compare \
-Wbool-operation \
-Wbuiltin-declaration-mismatch \
-Wbuiltin-macro-redefined \
-Wc90-c99-compat \
-Wc99-c11-compat \
-Wcast-qual \
-Wchar-subscripts \
-Wchkp \
-Wclobbered \
-Wcomment \
-Wconversion \
-Wcpp \
-Wdangling-else \
-Wdate-time \
-Wdeclaration-after-statement \
-Wdeprecated \
-Wdesignated-init \
-Wdiscarded-array-qualifiers \
-Wdiscarded-qualifiers \
-Wdiv-by-zero \
-Wdouble-promotion \
-Wduplicate-decl-specifier \
-Wduplicated-branches \
-Wduplicated-cond \
-Wempty-body \
-Wendif-labels \
-Wenum-compare \
-Werror \
-Wexpansion-to-defined \
-Wfloat-conversion \
-Wfloat-equal \
-Wformat-contains-nul \
-Wformat-extra-args \
-Wformat-nonliteral \
-Wformat-overflow=2 \
-Wformat-security \
-Wformat-signedness \
-Wformat-truncation=2 \
-Wformat-y2k \
-Wformat-zero-length \
-Wformat=2 \
-Wframe-address \
-Wignored-attributes \
-Wignored-qualifiers \
-Wimplicit \
-Wimplicit-fallthrough=3 \
-Wimplicit-function-declaration \
-Wimplicit-int \
-Wimport \
-Wincompatible-pointer-types \
-Winit-self \
-Wint-conversion \
-Wint-in-bool-context \
-Wint-to-pointer-cast \
-Winvalid-pch \
-Wjump-misses-init \
-Wlogical-not-parentheses \
-Wlogical-op \
-Wlong-long \
-Wmain \
-Wmaybe-uninitialized \
-Wmemset-elt-size \
-Wmemset-transposed-args \
-Wmisleading-indentation \
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-field-initializers \
-Wmissing-include-dirs \
-Wmissing-parameter-type \
-Wmissing-prototypes \
-Wmudflap \
-Wmultichar \
-Wnarrowing \
-Wnested-externs \
-Wnonnull \
-Wnonnull-compare \
-Wnormalized \
-Wnormalized=nfkc \
-Wold-style-declaration \
-Wold-style-definition \
-Wopenmp-simd \
-Woverlength-strings \
-Woverride-init \
-Woverride-init-side-effects \
-Wpacked-bitfield-compat \
-Wparentheses \
-Wpedantic \
-Wpointer-arith \
-Wpointer-compare \
-Wpointer-sign \
-Wpointer-to-int-cast \
-Wpragmas \
-Wpsabi \
-Wredundant-decls \
-Wrestrict \
-Wreturn-type \
-Wscalar-storage-order \
-Wsequence-point \
-Wshift-count-negative \
-Wshift-count-overflow \
-Wshift-negative-value \
-Wshift-overflow=2 \
-Wsign-compare \
-Wsign-conversion \
-Wsizeof-array-argument \
-Wsizeof-pointer-memaccess \
-Wstrict-aliasing=3 \
-Wstrict-overflow=5 \
-Wstrict-prototypes \
-Wstringop-overflow=4 \
-Wsuggest-attribute=const \
-Wsuggest-attribute=format \
-Wsuggest-attribute=noreturn \
-Wsuggest-attribute=pure \
-Wswitch \
-Wswitch-bool \
-Wswitch-default \
-Wswitch-enum \
-Wsync-nand \
-Wsystem-headers \
-Wtautological-compare \
-Wtraditional \
-Wtraditional-conversion \
-Wtrigraphs \
-Wundef \
-Wuninitialized \
-Wunknown-pragmas \
-Wunsuffixed-float-constants \
-Wunused \
-Wunused-const-variable=2 \
-Wunused-local-typedefs \
-Wunused-macros \
-Wunused-result \
-Wunused-variable \
-Wvarargs \
-Wvariadic-macros \
-Wvla \
-Wvolatile-register-var \
-Wwrite-strings \
\
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment