ref: b50f496107605f180550f4a389003fe51128af6b
parent: c0f93693b276a71a3c86339289bb7fc17a5f2fea
author: cancel <cancel@cancel.fm>
date: Wed Jan 8 21:53:47 EST 2020
Add tcc debug flag and more warning flags Adds -Wwrite-strings for all compilers. Adds -b for tcc in debug builds (bounds check.)
--- a/tool
+++ b/tool
@@ -226,12 +226,16 @@
local libraries=()
local source_files=()
local out_exe
- add cc_flags -std=c99 -pipe -finput-charset=UTF-8 -Wall -Wpedantic -Wextra
+ add cc_flags -std=c99 -pipe -finput-charset=UTF-8 -Wall -Wpedantic -Wextra \
+ -Wwrite-strings
if cc_id_and_vers_gte gcc 6.0.0 || cc_id_and_vers_gte clang 3.9.0; then
add cc_flags -Wconversion -Wshadow -Wstrict-prototypes \
-Werror=implicit-function-declaration -Werror=implicit-int \
-Werror=incompatible-pointer-types -Werror=int-conversion
fi
+ if [[ $cc_id = tcc ]]; then
+ add cc_flags -Wunsupported
+ fi
if [[ $lld_detected = 1 ]]; then
add cc_flags -fuse-ld=lld
fi
@@ -265,6 +269,9 @@
# least
# add cc_flags -fsanitize=leak
fi
+ case $cc_id in
+ tcc) add cc_flags -b;;
+ esac
;;
release)
add cc_flags -DNDEBUG -O2 -g0