|
From: openocd-gerrit <ope...@us...> - 2026-03-08 10:26:07
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via e4c49d86052dfc241ec60bbd3b7e190307891722 (commit)
from 22e1e1b33e844c343eb3f24d24f630e2471d2b27 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e4c49d86052dfc241ec60bbd3b7e190307891722
Author: Marc Schink <de...@za...>
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 <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9477
Reviewed-by: Anatoly P <kup...@gm...>
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/server/server.c b/src/server/server.c
index 62c2ce821..a48c0dba9 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
-----------------------------------------------------------------------
Summary of changes:
src/server/server.c | 1 -
1 file changed, 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|