@@ -441,6 +441,8 @@ echo "#include \"my_config.hpp\"" > $CONFIG_H
441441C_FLAGS+=" -include config.h"
442442rm -f src/precompiled.hpp.gch
443443
444+ EXTRA_CHECKS=" -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-common"
445+
444446#
445447# for backtraces, but it doesn't help much
446448#
@@ -501,8 +503,8 @@ case "$MY_OS_NAME" in
501503 DSYM=" dsymutil \$ {TARGET_GAME} &"
502504
503505 if [[ $OPT_DEV2 != " " ]]; then
504- C_FLAGS+=" -fsanitize=address -fno-omit-frame-pointer "
505- LDFLAGS+=" -fsanitize=address "
506+ C_FLAGS+=" $EXTRA_CHECKS "
507+ LDFLAGS+=" $EXTRA_CHECKS "
506508 fi
507509 ;;
508510 * inux* )
@@ -511,8 +513,8 @@ case "$MY_OS_NAME" in
511513 LDLIBS+=" -lGL "
512514
513515 if [[ $OPT_DEV2 != " " ]]; then
514- C_FLAGS+=" -fsanitize=address -fno-omit-frame-pointer -fno-common "
515- LDFLAGS+=" -fsanitize=address "
516+ C_FLAGS+=" $EXTRA_CHECKS "
517+ LDFLAGS+=" $EXTRA_CHECKS "
516518 fi
517519
518520 pkg-config --print-provides libunwind > /dev/null 2> /dev/null
@@ -562,7 +564,7 @@ if [[ $OPT_REL != "" ]]; then
562564 #
563565 echo " COMPILER_FLAGS=$WERROR $C_FLAGS -O3 -ffast-math -g" > .Makefile
564566else
565- echo " COMPILER_FLAGS=$WERROR $C_FLAGS -O0 -g" > .Makefile
567+ echo " COMPILER_FLAGS=$WERROR $C_FLAGS -Og -g" > .Makefile
566568fi
567569
568570if [[ $OPT_DEV2 != " " ]]; then
@@ -581,8 +583,9 @@ WARNING_FLAGS+=-Wno-unknown-warning-option
581583#
582584# Additional warnings for uninitialized variables; seem to be gcc only
583585#
586+ WARNING_FLAGS+=-Wuninitialized
584587WARNING_FLAGS+=-Wmaybe-uninitialized
585- # WARNING_FLAGS+=-Wuninitialized=verbose
588+ WARNING_FLAGS+=-Wuninitialized=verbose
586589#WARNING_FLAGS+=-Wunsafe-buffer-usage -fsafe-buffer-usage-suggestions
587590#
588591# When compiling C, give string constants the type const char[length] so that copying the address of
0 commit comments