Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Fix #293, enable compiler warnings in debug mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Heinrich Kuttler committed Dec 16, 2021
1 parent d325cf1 commit aaa7d9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
"${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address"
)
endif()
if(MSVC)
# warning level 4 and all warnings as errors
add_compile_options(/W4 /WX)
else()
# lots of warnings and all warnings as errors
add_compile_options(-Wall)
endif()
elseif(CMAKE_BUILD_TYPE MATCHES Release)
message("Release build.")
else()
Expand Down
5 changes: 2 additions & 3 deletions win/rl/pynethack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ class Nethack
{
public:
Nethack(std::string dlpath, std::string ttyrec, bool spawn_monsters)
: dlpath_(std::move(dlpath)), obs_{},
ttyrec_(std::fopen(ttyrec.c_str(), "a")),
spawn_monsters_(spawn_monsters)
: dlpath_(std::move(dlpath)), obs_{}, spawn_monsters_(spawn_monsters),
ttyrec_(std::fopen(ttyrec.c_str(), "a"))
{
if (!ttyrec_) {
PyErr_SetFromErrnoWithFilename(PyExc_OSError, ttyrec.c_str());
Expand Down

0 comments on commit aaa7d9a

Please sign in to comment.