diff --git a/c++/Makefile b/c++/Makefile index d834a23..7aceff8 100644 --- a/c++/Makefile +++ b/c++/Makefile @@ -1,5 +1,5 @@ aoc-cpp: $(wildcard *.cpp) - g++ -std=c++20 -o aoc-cpp $^ + g++ -std=c++20 -Wall -Wextra -o aoc-cpp $^ all: aoc-cpp diff --git a/c++/problem2.cpp b/c++/problem2.cpp index db9d6ba..0a354a4 100644 --- a/c++/problem2.cpp +++ b/c++/problem2.cpp @@ -9,7 +9,7 @@ pair solve2(istream& input) { uint64_t part1 = 0, part2 = 0; for (string line; getline(input, line); ) { stringstream line_stream(line); - int64_t min_count, max_count; + uint64_t min_count, max_count; char target; string password; line_stream >> min_count; diff --git a/c++/problem3.cpp b/c++/problem3.cpp index 2f986ea..c57f972 100644 --- a/c++/problem3.cpp +++ b/c++/problem3.cpp @@ -28,7 +28,7 @@ pair solve3(istream& input) { uint64_t part1; for (auto slope : slopes) { uint64_t total_trees = 0; - for (auto pos = pair(0, 0); pos.second < my_map.size(); ) { + for (auto pos = pair(0, 0); pos.second < my_map.size(); ) { total_trees += (int) my_map[pos.second][pos.first] == '#'; pos.first = (pos.first + slope.first) % width; pos.second += slope.second;