gcc 4.9.0 20130616 (experimental) diagnoses a warning for the following code compiled with the flags: -Wall -pedantic -std=c++11 //------------------------------------- void* po = 0; void (*pf)() = reinterpret_cast<decltype(pf)>(po); // #2 static_assert(sizeof(po) >= sizeof(pf), "Conversion not supported"); //------------------------------------- "main.cpp|2|warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [enabled by default]" Given that 5.2.10 p8 says: "Converting a function pointer to an object pointer type or vice versa is conditionally-supported." and since to my knowledge gcc supports such conversions (without that ::dlopen wouldn't work), the warning should be removed in the context of C++11.
Seems easy to fix. We got this (outdated) comment: if (pedantic && (complain & tf_warning)) /* Only issue a warning, as we have always supported this where possible, and it is necessary in some cases. DR 195 addresses this issue, but as of 2004/10/26 is still in drafting. */ warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object"); thus it seems just matter of suppressing he warning for c++11 (and c++1y) and updating the comment.
Fixed for 4.9.0.