From 81b2fa5d3c270a377504eb5002f0168fc02fd2ff Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 23 Feb 2023 18:31:40 -0500 Subject: [PATCH] enable warnings --- Makefile | 3 ++- dictionary.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 560defa..4307ca0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -CXXFLAGS += -std=c++17 -g3 -ggdb -O0 +CXXFLAGS += -std=c++17 -g3 -ggdb -O0 \ + -Wall -Wextra -pedantic -Wno-vla -Werror CXXFILES := corewords.cpp dictionary.cpp parser.cpp state.cpp types.cpp OBJFILES := $(subst .cpp,.o,$(CXXFILES)) diff --git a/dictionary.cpp b/dictionary.cpp index de10303..1ac2839 100644 --- a/dictionary.cpp +++ b/dictionary.cpp @@ -115,7 +115,7 @@ Word Dictionary::input() bool Dictionary::equal(Word word, std::string_view sv) const { - if (sv.size() != word.end - word.start) + if (sv.size() != static_cast(word.end - word.start)) return false; for (unsigned i = 0; i < sv.size(); ++i) {