diff --git a/ci/configs/default.bash b/ci/configs/default.bash index f36f4e49..492992c6 100644 --- a/ci/configs/default.bash +++ b/ci/configs/default.bash @@ -1,5 +1,5 @@ CI_DESC="CI job using default libraries and tools, and running IWYU" CI_DIR=build-default -export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wextra-semi -Wmissing-noreturn -Wtrailing-whitespace" +export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wundef -Wunused-const-variable -Wno-unused-parameter -Wextra-semi -Wmissing-noreturn -Wtrailing-whitespace" CMAKE_ARGS=(-DMP_ENABLE_IWYU=ON) BUILD_ARGS=(-k) diff --git a/ci/configs/gnu32.bash b/ci/configs/gnu32.bash index 04d78a24..3d63360f 100644 --- a/ci/configs/gnu32.bash +++ b/ci/configs/gnu32.bash @@ -6,6 +6,6 @@ NIX_ARGS=( --arg minimal true --arg crossPkgs 'import { crossSystem = { config = "i686-unknown-linux-gnu"; }; }' ) -export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter" +export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-const-variable -Wno-unused-parameter" CMAKE_ARGS=(-G Ninja) BUILD_ARGS=(-k 0) diff --git a/ci/configs/llvm.bash b/ci/configs/llvm.bash index af3b9719..4257db83 100644 --- a/ci/configs/llvm.bash +++ b/ci/configs/llvm.bash @@ -2,7 +2,7 @@ CI_DESC="CI job using LLVM-based libraries and tools (clang, libc++, clang-tidy, CI_DIR=build-llvm NIX_ARGS=(--arg enableLibcxx true) export CXX=clang++ -export CXXFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wpedantic -Wthread-safety -Wno-unused-parameter -Wno-c++23-lambda-attributes" +export CXXFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wpedantic -Wundef -Wthread-safety -Wno-unused-parameter -Wno-c++23-lambda-attributes" CMAKE_ARGS=( -G Ninja -DMP_ENABLE_CLANG_TIDY=ON diff --git a/ci/configs/newdeps.bash b/ci/configs/newdeps.bash index a86f9dee..c86a833d 100644 --- a/ci/configs/newdeps.bash +++ b/ci/configs/newdeps.bash @@ -1,6 +1,6 @@ CI_DESC="CI job using newest Cap'n Proto and cmake versions" CI_DIR=build-newdeps -export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-error=array-bounds" +export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-const-variable -Wno-unused-parameter -Wno-error=array-bounds" CAPNP_CHECKOUT=master # This is the v1.x release branch NIX_ARGS=(--argstr capnprotoVersion "none" --argstr cmakeVersion "4.3.4") BUILD_ARGS=(-k) diff --git a/ci/configs/olddeps.bash b/ci/configs/olddeps.bash index 1d9ea6fc..81d084fc 100644 --- a/ci/configs/olddeps.bash +++ b/ci/configs/olddeps.bash @@ -2,7 +2,7 @@ CI_DESC="CI job using old Cap'n Proto and cmake versions" CI_DIR=build-olddeps # Pin olddeps to an older Nixpkgs channel, to be able to test an older GCC. CI_NIXPKGS_CHANNEL=nixos-25.05 -export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-error=array-bounds" +export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-const-variable -Wno-unused-parameter -Wno-error=array-bounds" CAPNP_CHECKOUT=v0.9.2 # Use a checkout to compile it with the selected GCC NIX_ARGS=(--argstr capnprotoVersion "none" --argstr cmakeVersion "3.12.4" --argstr gccVersion "10") BUILD_ARGS=(-k) diff --git a/include/mp/proxy-types.h b/include/mp/proxy-types.h index 0c00b825..9822c121 100644 --- a/include/mp/proxy-types.h +++ b/include/mp/proxy-types.h @@ -15,7 +15,7 @@ // KJ exception support is required, or exceptions thrown in serverInvoke below go uncaught // and crash the process instead of being returned to the client as errors. -#if KJ_NO_EXCEPTIONS +#if defined(KJ_NO_EXCEPTIONS) && KJ_NO_EXCEPTIONS #error "KJ_NO_EXCEPTIONS=1 is set but libmultiprocess requires support for exceptions. Please check build settings. On NetBSD you may also need to set -DKJ_NO_EXCEPTIONS=0 -DKJ_NO_RTTI=0 explicitly (https://github.com/capnproto/capnproto/pull/2756)" #endif diff --git a/include/mp/util.h b/include/mp/util.h index 30742014..adc7cfbb 100644 --- a/include/mp/util.h +++ b/include/mp/util.h @@ -293,7 +293,7 @@ using Stream = kj::Own; using ProcessId = int; using SocketId = int; -constexpr SocketId SocketError{-1}; +inline constexpr SocketId SocketError{-1}; //! Information about parent process passed to child process as a command-line //! argument. On unix this is the child socket fd number formatted as a string.