This is an automated email from Gerrit. "Marc Schink <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9477
-- gerrit commit 7c62d1b59f52a94a361275dee305a50c89e2a27c Author: Marc Schink <[email protected]> Date: Thu Feb 26 10:14:34 2026 +0100 server/server: Fix build on FreeBSD On FreeBSD, sig_atomic_t is of type 'long' rather than 'int'. Remove the assert() instead of replacing it with a more complex, size-agnostic check that would handle both 'int' and 'long'. Since the signal number comes from the operating system, an explicit range check is unnecessary. Checkpatch-ignore: COMMIT_LOG_LONG_LINE Build error on FreeBSD: ../src/server/server.c:616:39: error: result of comparison of constant 9223372036854775807 with expression of type 'int' is always true [-Werror,-Wtautological-constant-out-of-range-compare] 616 | assert(sig >= SIG_ATOMIC_MIN && sig <= SIG_ATOMIC_MAX); | ~~~ ^ ~~~~~~~~~~~~~~ /usr/include/assert.h:55:21: note: expanded from macro 'assert' 55 | #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ | ^ ../src/server/server.c:616:14: error: result of comparison of constant -9223372036854775808 with expression of type 'int' is always true [-Werror,-Wtautological-constant-out-of-range-compare] 616 | assert(sig >= SIG_ATOMIC_MIN && sig <= SIG_ATOMIC_MAX); | ~~~ ^ ~~~~~~~~~~~~~~ /usr/include/assert.h:55:21: note: expanded from macro 'assert' 55 | #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ Change-Id: I6cf9242ab8206184bff9390ef0245843261656bd Signed-off-by: Marc Schink <[email protected]> diff --git a/src/server/server.c b/src/server/server.c index 0b957836d3..0e18c50a93 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -613,7 +613,6 @@ static void sig_handler(int sig) /* store only first signal that hits us */ if (shutdown_openocd == CONTINUE_MAIN_LOOP) { shutdown_openocd = SHUTDOWN_WITH_SIGNAL_CODE; - assert(sig >= SIG_ATOMIC_MIN && sig <= SIG_ATOMIC_MAX); last_signal = sig; LOG_DEBUG("Terminating on Signal %d", sig); } else --
