Browse Source

FindThreads: Add missing static keyword in pthread test code

When CMAKE_C_FLAGS contains '-Werror -Wmissing-prototypes'
the pthread test code check fails with error:
"src.c:3:7: error: no previous prototype for 'test_func' [-Werror=missing-prototypes]".
Adding 'static' keyword to 'test_func' fixes it.
Pavel Otchertsov 5 years ago
parent
commit
6ef64013ba
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/FindThreads.cmake

+ 1 - 1
Modules/FindThreads.cmake

@@ -66,7 +66,7 @@ endif()
 set(PTHREAD_C_CXX_TEST_SOURCE [====[
 #include <pthread.h>
 
-void* test_func(void* data)
+static void* test_func(void* data)
 {
   return data;
 }