M
Miguel Guedes
Is it possible to get rid of the warning below generated at compile time
without resorting to any compiler directive trickery? (ie. pragmas and
the likes)
Both g++ and clang++ report the following warning when casting a void *
pointer retrieved from dlsym (after loading an SO dynamic library.)
warning: cast between pointer-to-function and
pointer-to-object is an extension [-pedantic]
if(!(fn_main = reinterpret_cast<Omnisource* (*)(void *)>(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Relevant bit of code:
if(!(fn_main = reinterpret_cast<Omnisource* (*)(void *)>(
dlsym(handle, "omnisource_main"))))
throw std::runtime_error(dlerror());
without resorting to any compiler directive trickery? (ie. pragmas and
the likes)
Both g++ and clang++ report the following warning when casting a void *
pointer retrieved from dlsym (after loading an SO dynamic library.)
warning: cast between pointer-to-function and
pointer-to-object is an extension [-pedantic]
if(!(fn_main = reinterpret_cast<Omnisource* (*)(void *)>(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Relevant bit of code:
if(!(fn_main = reinterpret_cast<Omnisource* (*)(void *)>(
dlsym(handle, "omnisource_main"))))
throw std::runtime_error(dlerror());