Updated C and C++ makefiles to exclude warnings and sanitizers by default, instead recommending extra flags for manually doing a diagnostic/debug build.

This commit is contained in:
Project Nayuki 2019-08-09 23:00:13 +00:00
parent 50d00ebf76
commit 7eac8beffe
2 changed files with 10 additions and 12 deletions

View File

@ -28,12 +28,11 @@
# - CC: The C compiler, such as gcc or clang.
# - CFLAGS: Any extra user-specified compiler flags (can be blank).
# Mandatory compiler flags
CFLAGS += -std=c99
# Diagnostics. Adding '-fsanitize=address' is helpful for most versions of Clang and newer versions of GCC.
CFLAGS += -Wall -fsanitize=undefined
# Optimization level
CFLAGS += -O1
# Recommended compiler flags:
CFLAGS += -std=c99 -O
# Extra flags for diagnostics:
# CFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
# ---- Controlling make ----

View File

@ -28,12 +28,11 @@
# - CXX: The C++ compiler, such as g++ or clang++.
# - CXXFLAGS: Any extra user-specified compiler flags (can be blank).
# Mandatory compiler flags
CXXFLAGS += -std=c++11
# Diagnostics. Adding '-fsanitize=address' is helpful for most versions of Clang and newer versions of GCC.
CXXFLAGS += -Wall -fsanitize=undefined
# Optimization level
CXXFLAGS += -O1
# Recommended compiler flags:
CXXFLAGS += -std=c++11 -O
# Extra flags for diagnostics:
# CXXFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
# ---- Controlling make ----