util: fix pointer type on NetBSD
authorEric Engestrom <eric.engestrom@intel.com>
Fri, 2 Aug 2019 23:32:28 +0000 (00:32 +0100)
committerEric Engestrom <eric@engestrom.ch>
Sat, 3 Aug 2019 00:20:21 +0000 (00:20 +0000)
NetBSD expects a `void *` argument [1] as the printf-style arguments to
the formatting string, so we need to cast the `const` away.

[1] https://netbsd.gw.com/cgi-bin/man-cgi?pthread_setname_np++NetBSD-current

Suggested-by: Kamil Rytarowski <n54@gmx.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/util/u_thread.h

index b240b446aa28bf00211444f9453a5337aabe9869..1648d2f58418478e669f0b0369f63fa3131f61e8 100644 (file)
@@ -67,7 +67,7 @@ static inline void u_thread_setname( const char *name )
 #elif DETECT_OS_FREEBSD || DETECT_OS_OPENBSD
    pthread_set_name_np(pthread_self(), name);
 #elif DETECT_OS_NETBSD
-   pthread_setname_np(pthread_self(), "%s", name);
+   pthread_setname_np(pthread_self(), "%s", (void *)name);
 #elif DETECT_OS_APPLE
    pthread_setname_np(name);
 #else