From 7af974eeaa7e5cf2f73e3176782c5a788a74f08e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Wed, 15 Aug 2018 13:57:01 -0700 Subject: [PATCH] test: make sure pthread is defined avoid warnings with any modern C99 compiler due to implicit function declaration for pthread_create, as shown by the following : test/regress_dns.c:2226:2: warning: implicit declaration of function 'pthread_create' is invalid in C99 [-Wimplicit-function-declaration] THREAD_START(thread[0], race_base_run, &rp); ^ test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START' pthread_create(&(threadvar), NULL, fn, arg) ^ test/regress_dns.c:2226:2: warning: this function declaration is not a prototype [-Wstrict-prototypes] test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START' pthread_create(&(threadvar), NULL, fn, arg) ^ $ clang --version Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin Closes: #686 (cherry-picked) --- test/regress_thread.h | 1 + 1 file changed, 1 insertion(+) diff --git a/test/regress_thread.h b/test/regress_thread.h index 831b51e5..db0d8d19 100644 --- a/test/regress_thread.h +++ b/test/regress_thread.h @@ -28,6 +28,7 @@ #define REGRESS_THREAD_H_INCLUDED_ #ifdef EVENT__HAVE_PTHREADS +#include #define THREAD_T pthread_t #define THREAD_FN void * #define THREAD_RETURN() return (NULL) -- 2.50.1