changed gcc optimization level from "-O3" to "-O2" for releases
authorHolger Schemel <info@artsoft.org>
Fri, 2 Oct 2020 12:51:59 +0000 (14:51 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 2 Oct 2020 12:51:59 +0000 (14:51 +0200)
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.

src/Android.mk
src/Makefile

index f0755630c59cedb633c2bd8f120bdf4ce65dc155..9cc304735b4f7251ca54bdabfdc35123bea48723 100644 (file)
@@ -28,7 +28,7 @@ LOCAL_C_INCLUDES :=                           \
 
 DEBUG = -DDEBUG -g
 OPTIONS = $(DEBUG) -Wall                       # only for debugging purposes
 
 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)
 
 # LOCAL_CFLAGS := -DTARGET_SDL2
 LOCAL_CFLAGS := -DTARGET_SDL2 $(OPTIONS)
index 0c8a9acd67dd748c3aace06677213a189a977fce..af907f8c342bd09e56be62056e8cd21e3cf9412f 100644 (file)
@@ -109,18 +109,18 @@ DEBUG = -DDEBUG -g
 # PROFILING = $(PROFILING_FLAGS)
 
 # OPTIONS = $(DEBUG) -Wall                     # only for debugging purposes
 # 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 = $(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'%")
 
 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)
 endif
 
 CFLAGS = $(OPTIONS) $(SYS_CFLAGS)  $(EXTRA_CFLAGS) $(CONFIG)