shithub: cstory

Download patch

ref: a1937b47303467224b8e42e594685821a50c8699
parent: 78a066ce7538169b99eae60b94003717a50547bb
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Jan 15 02:45:36 EST 2020

Backport the portable branch's warnings

--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,24 @@
   ALL_CXXFLAGS += -DDEBUG_SAVE
 endif
 
-ALL_CXXFLAGS += -std=c++98 -Wall -Wextra -pedantic -MMD -MP -MF $@.d
+ifeq ($(WARNINGS), 1)
+  ALL_CXXFLAGS += -Wall -Wextra -pedantic
+endif
+
+ifeq ($(WARNINGS_ALL), 1)
+  ifneq ($(findstring clang,$(CXX)),)
+    # Use clang-specific flag -Weverything
+    ALL_CXXFLAGS += -Weverything
+  else
+    $(warning Couldn't activate all warnings (unsupported compiler))
+  endif
+endif
+
+ifeq ($(WARNINGS_FATAL), 1)
+  ALL_CXXFLAGS += -Werror
+endif
+
+ALL_CXXFLAGS += -std=c++98 -MMD -MP -MF $@.d
 ALL_LIBS += -lkernel32 -lgdi32 -lddraw -ldinput -ldsound -lversion -lshlwapi -limm32 -lwinmm -ldxguid
 
 ifeq ($(STATIC), 1)
--- a/README.md
+++ b/README.md
@@ -55,6 +55,9 @@
 `JAPANESE=1` | Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)
 `FIX_BUGS=1` | Fix various bugs in the game
 `DEBUG_SAVE=1` | Re-enable the dummied-out 'Debug Save' option, and the ability to drag-and-drop save files onto the window
+`WARNINGS=1` | Enable common warnings
+`WARNINGS_ALL=1` | Enable ALL warnings (clang only)
+`WARNINGS_FATAL=1` | Make all warnings errors
 
 ## Licensing