mirror of
https://github.com/depp/syncfiles.git
synced 2024-11-22 03:30:57 +00:00
ad220442d7
The -std=c89 option is too pedantic, and the old CodeWarrior compiler accepts various extensions (like line comments) anyway. Rather than using -std=c89 to ensure the code is compatible with old compilers, we will actually test on the old compilers.
41 lines
834 B
Python
41 lines
834 B
Python
# Bazel + GCC,
|
|
# Default:
|
|
# -U_FORTIFY_SOURCE
|
|
# -Wall
|
|
# -Wunused-but-set-parameter
|
|
# -Wno-free-nonheap-object
|
|
# -fno-omit-frame-pointer
|
|
# With -c dbg, adds:
|
|
# -g
|
|
# With -c opt, adds:
|
|
# -g0 -O2
|
|
|
|
# Base C options
|
|
COPTS_BASE = [
|
|
"-std=c11",
|
|
]
|
|
|
|
_COPTS_WARNING = [
|
|
"-Wall",
|
|
"-Wextra",
|
|
"-Wpointer-arith",
|
|
"-Wwrite-strings",
|
|
"-Wmissing-prototypes",
|
|
"-Wdouble-promotion",
|
|
"-Werror=implicit-function-declaration",
|
|
"-Winit-self",
|
|
"-Wstrict-prototypes",
|
|
"-Wno-format-zero-length",
|
|
]
|
|
|
|
# Internal C compilation options. Use this by default for all C targets in the
|
|
# repo.
|
|
COPTS = (
|
|
COPTS_BASE +
|
|
select({
|
|
"//bazel:warnings_off": [],
|
|
"//bazel:warnings_on": _COPTS_WARNING,
|
|
"//bazel:warnings_error": _COPTS_WARNING + ["-Werror"],
|
|
})
|
|
)
|