Browse Source

GCC8 tries to be more strict with type casting especially with functions so typecast
needs to be redone as it fix:
libtest/thread.hpp:227:13: error: cast between incompatible function types from ‘void (*)(context_st*)’
to ‘libtest::thread::Thread::start_routine_fn’ {aka ‘void* (*)(void*)’} [-Werror=cast-function-type]

Tuukka Pasanen 6 years ago
parent
commit
56d23f83a7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libtest/thread.hpp

+ 1 - 1
libtest/thread.hpp

@@ -224,7 +224,7 @@ public:
   template <class Function,class Arg1>
     Thread(Function func, Arg1 arg):
       _joined(false),
-      _func((start_routine_fn)func),
+      _func((start_routine_fn)(void(*)())func),
       _context(arg)
     {
       int err;