From b50f496107605f180550f4a389003fe51128af6b Mon Sep 17 00:00:00 2001 From: cancel Date: Thu, 9 Jan 2020 02:53:47 +0900 Subject: [PATCH] Add tcc debug flag and more warning flags Adds -Wwrite-strings for all compilers. Adds -b for tcc in debug builds (bounds check.) --- tool | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tool b/tool index a520919..aba6c36 100755 --- a/tool +++ b/tool @@ -226,12 +226,16 @@ build_target() { 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 @@ build_target() { # least # add cc_flags -fsanitize=leak fi + case $cc_id in + tcc) add cc_flags -b;; + esac ;; release) add cc_flags -DNDEBUG -O2 -g0