From: Holger Schemel Date: Fri, 2 Oct 2020 12:51:59 +0000 (+0200) Subject: changed gcc optimization level from "-O3" to "-O2" for releases X-Git-Tag: 4.2.0.3~12 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=0896ebe9d29a756c7adc005c6b93ff28f2fd396d changed gcc optimization level from "-O3" to "-O2" for releases This change was done due to general recommendations and because of some versions of gcc emitting lots of misleading warnings with "-O3" related to pointers possibly being null in cases where they surely cannot be null ("warning: argument 1 null where non-null expected" for "strcmp(s1, s2)" in src/libgame/misc.c after explicitly checking that s1 is not null), which makes it harder to recognize "real" warnings when building the distribution packages. --- diff --git a/src/Android.mk b/src/Android.mk index f0755630..9cc30473 100644 --- a/src/Android.mk +++ b/src/Android.mk @@ -28,7 +28,7 @@ LOCAL_C_INCLUDES := \ DEBUG = -DDEBUG -g OPTIONS = $(DEBUG) -Wall # only for debugging purposes -# OPTIONS = -O3 -Wall # distribution build +# OPTIONS = -O2 -Wall # distribution build # LOCAL_CFLAGS := -DTARGET_SDL2 LOCAL_CFLAGS := -DTARGET_SDL2 $(OPTIONS) diff --git a/src/Makefile b/src/Makefile index 0c8a9acd..af907f8c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -109,18 +109,18 @@ DEBUG = -DDEBUG -g # PROFILING = $(PROFILING_FLAGS) # OPTIONS = $(DEBUG) -Wall # only for debugging purposes -# OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes +# OPTIONS = $(DEBUG) -O2 -Wall # only for debugging purposes # OPTIONS = $(DEBUG) -Wall # only for debugging purposes OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes # OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes -# OPTIONS = -O3 -Wall -ansi -pedantic -# OPTIONS = -O3 -Wall -# OPTIONS = -O3 +# OPTIONS = -O2 -Wall -ansi -pedantic +# OPTIONS = -O2 -Wall +# OPTIONS = -O2 ifdef BUILD_DIST # distribution build SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) | \ sed -e "s%-rpath,[^ ]*%-rpath,'\$$ORIGIN/lib'%") -OPTIONS = -O3 -Wall +OPTIONS = -O2 -Wall endif CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(EXTRA_CFLAGS) $(CONFIG)