Explorar o código

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 %!s(int64=5) %!d(string=hai) anos
pai
achega
6ef64013ba
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;
 }