]> granicus.if.org Git - libevent/commit
test: make sure pthread is defined
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Wed, 15 Aug 2018 20:57:01 +0000 (13:57 -0700)
committerAzat Khuzhin <a3at.mail@gmail.com>
Thu, 13 Sep 2018 23:17:45 +0000 (02:17 +0300)
commit7af974eeaa7e5cf2f73e3176782c5a788a74f08e
tree8aa65ecb7ddea473a4d162f6ad7facecd36c4422
parent29cc8386a2f7911eaa9336692a2c5544d8b4734f
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