From fafae678f6cd8aaca2be8ece501b258160f7fbfa Mon Sep 17 00:00:00 2001 From: MacroFake Date: Thu, 19 May 2022 08:03:19 +0200 Subject: [PATCH] build: Enable RPC_DOC_CHECK on --enable-debug --- configure.ac | 1 + src/rpc/util.h | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6dcc5183ea..96fe38fe0d 100644 --- a/configure.ac +++ b/configure.ac @@ -378,6 +378,7 @@ if test "$enable_debug" = "yes"; then AX_CHECK_PREPROC_FLAG([-DDEBUG], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG"], [], [$CXXFLAG_WERROR]) AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"], [], [$CXXFLAG_WERROR]) + AX_CHECK_PREPROC_FLAG([-DRPC_DOC_CHECK], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DRPC_DOC_CHECK"], [], [$CXXFLAG_WERROR]) AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"], [], [$CXXFLAG_WERROR]) AX_CHECK_COMPILE_FLAG([-ftrapv], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -ftrapv"], [], [$CXXFLAG_WERROR]) fi diff --git a/src/rpc/util.h b/src/rpc/util.h index 6e23caff6c..abbc4c66fe 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -22,7 +22,13 @@ #include #include -static constexpr bool DEFAULT_RPC_DOC_CHECK{false}; +static constexpr bool DEFAULT_RPC_DOC_CHECK{ +#ifdef RPC_DOC_CHECK + true +#else + false +#endif +}; /** * String used to describe UNIX epoch time in documentation, factored out to a