From 16ae82f05d5deec2d56b29e14322309cf2888056 Mon Sep 17 00:00:00 2001 From: Avril Date: Sun, 8 Jan 2023 03:01:05 +0000 Subject: [PATCH] Changed `debug` target: Now uses -Og instead of -O0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added -DDEBUG-only redundant-initializers for vars `minmax_t()::{lowest, highest}` Fortune for shuffle3's current commit: Future blessing − 末吉 --- Makefile | 2 +- src/work.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 47983ea..cc426b6 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ RELEASE_CFLAGS?= -O3 -flto $(OPT_FLAGS) $(RELEASE_COMMON_FLAGS) RELEASE_CXXFLAGS?= -O3 -flto $(CXX_OPT_FLAGS) $(RELEASE_COMMON_FLAGS) RELEASE_LDFLAGS?= -Wl,-O3 -Wl,-flto -DEBUG_CFLAGS?= -O0 -g -DDEBUG +DEBUG_CFLAGS?= -Og -g -DDEBUG DEBUG_CXXFLAGS?= $(DEBUG_CFLAGS) DEBUG_LDFLAGS?= diff --git a/src/work.cpp b/src/work.cpp index 8c40c24..caab49f 100644 --- a/src/work.cpp +++ b/src/work.cpp @@ -15,8 +15,16 @@ template std::tuple minmax_t(const span& array, Fn keep) { - T highest; - T lowest; + T highest +#ifdef DEBUG + {} +#endif + ; + T lowest +#ifdef DEBUG + {} +#endif + ; bool init=false; D_dprintf("minmax_t: %p (%lu)", array.as_ptr(), array.size()); for(std::size_t i=0;i