|
From: openocd-gerrit <ope...@us...> - 2026-04-06 16:50:19
|
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 b80f554fd982b65bd3b45bb151655abe634e938b (commit)
from 3d83e9546e1f5050a7079eeca0a18d4259cd4949 (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 b80f554fd982b65bd3b45bb151655abe634e938b
Author: Marc Schink <de...@za...>
Date: Thu Feb 26 15:48:43 2026 +0100
helper/log: Fix build issue on MSYS2 and Cygwin
On MSYS2 (native) and Cygwin, the mallinfo struct uses 'size_t' instead
of 'int', which leads to a compile-time error with the current code.
Update the preprocessor logic so that Cygwin and MSYS2 builds use
the 'size_t' format specifier.
Checkpatch-ignore: COMMIT_LOG_LONG_LINE
Build error on MSYS2:
../src/helper/log.c: In function 'get_free_memory_space':
../src/helper/log.c:78:45: error: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
78 | snprintf(s, MEM_STR_LEN, " %d", info.fordblks);
| ~^ ~~~~~~~~~~~~~
| | |
| int size_t {aka long unsigned int}
| %ld
Change-Id: I18d772facba6426ab627fb45a6d50bfc19ec9c05
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9479
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/helper/log.c b/src/helper/log.c
index afba0d172..ce21a907d 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -75,7 +75,11 @@ static void get_free_memory_space(char *s)
#elif defined(HAVE_MALLINFO)
if (LOG_LEVEL_IS(LOG_LVL_DEBUG_MALLOC)) {
struct mallinfo info = mallinfo();
+#if IS_CYGWIN
+ snprintf(s, MEM_STR_LEN, " %zu", info.fordblks);
+#else
snprintf(s, MEM_STR_LEN, " %d", info.fordblks);
+#endif
return;
}
#endif
-----------------------------------------------------------------------
Summary of changes:
src/helper/log.c | 4 ++++
1 file changed, 4 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|