From deb389340d6efddc4d4800902b12bd0113c383b0 Mon Sep 17 00:00:00 2001 From: Minty-Meeo <45425365+Minty-Meeo@users.noreply.github.com> Date: Thu, 23 Mar 2023 20:18:30 -0500 Subject: [PATCH] Resolve '-Wzero-as-null-pointer-constant' warning --- Makefile | 4 ++-- OptionParser.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 19cab9d..65bfec0 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ ifeq ($(WARN),1) ifeq ($(CXX),g++) -WARN_FLAGS = -O3 -g -Wall -Wextra -Werror # -Weffc++ +WARN_FLAGS = -O3 -g -Wall -Wextra -Wzero-as-null-pointer-constant -Werror # -Weffc++ else ifeq ($(CXX),clang++) -WARN_FLAGS = -O3 -g -Wall -Wextra -Werror +WARN_FLAGS = -O3 -g -Wall -Wextra -Wzero-as-null-pointer-constant -Werror else ifeq ($(CXX),icpc) WARN_FLAGS = -O3 -ipo -g -Wall -wd981 -wd383 -wd2259 -Werror # -Weffc++ endif diff --git a/OptionParser.h b/OptionParser.h index 1556091..1bab395 100644 --- a/OptionParser.h +++ b/OptionParser.h @@ -76,7 +76,7 @@ class Values { class Option { public: Option(const OptionParser& p) : - _parser(p), _action("store"), _type("string"), _nargs(1), _callback(0) {} + _parser(p), _action("store"), _type("string"), _nargs(1), _callback(nullptr) {} virtual ~Option() {} Option& action(const std::string& a);