Skip to content

Commit 83cce28

Browse files
committed
Treat all warnings as errors (non wasm)
1 parent 238c7a8 commit 83cce28

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ jobs:
227227
-DCMAKE_INSTALL_PREFIX=$PREFIX \
228228
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
229229
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
230+
-DCMAKE_COMPILE_WARNING_AS_ERROR=false \
230231
..
231232
EMCC_CFLAGS='-sERROR_ON_UNDEFINED_SYMBOLS=0' emmake make -j ${{ env.ncpus }}
232233

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ OPTION(XEUS_CPP_BUILD_EXECUTABLE "Build the xcpp executable" ON)
4747
OPTION(XEUS_CPP_USE_SHARED_XEUS "Link xcpp with the xeus shared library (instead of the static library)" ON)
4848
OPTION(XEUS_CPP_USE_SHARED_XEUS_CPP "Link xcpp with the xeus shared library (instead of the static library)" ON)
4949

50+
option(CMAKE_COMPILE_WARNING_AS_ERROR "Compile warnings as errors" ON)
51+
5052
# Test options
5153
OPTION(XEUS_CPP_BUILD_TESTS "xeus-cpp test suite" ON)
5254
OPTION(XEUS_CPP_ENABLE_CODE_COVERAGE "xeus-cpp test suite" OFF)

src/xinterpreter.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ int __get_cxx_version () {
101101
__get_cxx_version ()
102102
)";
103103

104-
long cxx_version = Cpp::Evaluate(code);
105-
return std::to_string(cxx_version);
104+
auto cxx_version = Cpp::Evaluate(code);
105+
return std::to_string(cxx_version);
106106
}
107107

108108

@@ -138,6 +138,9 @@ __get_cxx_version ()
138138
{
139139
nl::json kernel_res;
140140

141+
142+
auto input_guard = input_redirection(allow_stdin);
143+
141144
// Check for magics
142145
for (auto& pre : preamble_manager.preamble)
143146
{

0 commit comments

Comments
 (0)