From 38a9f75952af34d0a8c36862b9c85b6b698f8488 Mon Sep 17 00:00:00 2001 From: saundersp Date: Sun, 24 Aug 2025 18:43:09 +0200 Subject: [PATCH] Makefile : Added more warning flags and hardening flags --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fb086eb..aa8a8a5 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,15 @@ CC := g++ -m64 -std=c++17 OBJ_DIR := bin SRC_DIR := . +# Optimizer flags #CFLAGS := -Og -g -rdynamic -pg -ggdb3 -D__DEBUG -CFLAGS := -O4 -CFLAGS := $(CFLAGS) -Wall -Werror -Wextra -Wno-error=unused-function -Wpedantic +CFLAGS := -O3 +# Warning flags +CFLAGS := $(CFLAGS) -Wall -Werror -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wconversion +CFLAGS := $(CFLAGS) -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -Wmisleading-indentation -Wduplicated-cond +CFLAGS := $(CFLAGS) -Wduplicated-branches -Wlogical-op -Wuseless-cast -Wsuggest-override +# Hardening flags +CFLAGS := $(CFLAGS) -fstack-protector-strong -fcf-protection -fstack-clash-protection -fsanitize=undefined -fno-sanitize-recover=undefined EXEC := $(OBJ_DIR)/data SRC := $(wildcard $(SRC_DIR)/*.cpp) HEADER := $(wildcard $(SRC_DIR)/*.hpp)