Closed gsnw closed 1 month ago
Thanks for noticing this and looking into it, @gsnw!
How about using the INT64_C(…)
macro to specify the type of the constant instead of using a cast to int64_t
?
On the affected macOS system, the type suffix for the numeric constant would need to be LL
to avoid the warning, but on an x86_64 GNU/Linux system the type suffix should be L
. The INT64_C(…)
macro is intended to choose the correct suffix for the given system.
The following patch works on my x86_64 GNU/Linux system:
diff --git a/src/seqmap.c b/src/seqmap.c
index 62506d0..7675bc1 100644
--- a/src/seqmap.c
+++ b/src/seqmap.c
@@ -57,7 +57,7 @@
static SEQMAP_VALUE* seqmap_map = NULL;
static unsigned int seqmap_next_id = 0;
-#define SEQMAP_TIMEOUT_IN_NS 10000000000
+#define SEQMAP_TIMEOUT_IN_NS INT64_C(10000000000)
#define SEQMAP_UNASSIGNED_HOST_NR UINT_MAX
void seqmap_init()
Ah thanks, I've learned something again. I didn't know that yet. I've changed it and tested it.
Fix macOS build warning