Skip to content

Instantly share code, notes, and snippets.

@mkhl
Created December 8, 2008 18:23
Show Gist options
  • Save mkhl/33547 to your computer and use it in GitHub Desktop.
Save mkhl/33547 to your computer and use it in GitHub Desktop.
GCC flags and stuff
-Wall
-Wextra
-Wfloat-equal
-Wpointer-arith
-Wstrict-prototypes
-Wold-style-definition
-Wshadow
-Wshorten-64-to-32
-Wmissing-prototypes
-Wunused-function
-Wunused-label
-Wunused-parameter
-Wunused-value
-Wunused-variable
# display all of GCC's predefined #defines
echo | gcc -dM -E -x c - | sort
if ENV['ANAL'] or ENV['DOMAIN'] =~ /zenspider/ then
builder.add_compile_flags "-Wall"
builder.add_compile_flags "-W"
builder.add_compile_flags "-Wpointer-arith"
builder.add_compile_flags "-Wcast-qual"
builder.add_compile_flags "-Wcast-align"
builder.add_compile_flags "-Wwrite-strings"
builder.add_compile_flags "-Wmissing-noreturn"
builder.add_compile_flags "-Wno-long-long"
# NOTE: this flag doesn't work w/ gcc 2.95.x - the FreeBSD default
# builder.add_compile_flags "-Wno-strict-aliasing"
# ruby.h screws these up hardcore:
# builder.add_compile_flags "-Wundef"
# builder.add_compile_flags "-Wconversion"
# builder.add_compile_flags "-Wstrict-prototypes"
# builder.add_compile_flags "-Wmissing-prototypes"
# builder.add_compile_flags "-Wsign-compare"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment