On Wed, Oct 8, 2008 at 12:05 PM, Roy Stogner <[EMAIL PROTECTED]> wrote: > > On Wed, 8 Oct 2008, John Peterson wrote: > >> I'm a little nervous about casting a function pointer to a void*. >> Technically this is not allowed (something about void* being reserved >> for data pointers, google for "function pointer to void*" on >> comp.lang.c++.moderated) which I assume is why you have used the >> implementation-defined reinterpret_cast. I think the main problem is >> that "a void* is not required to be of adequate size to hold a >> function pointer" but it is on all POSIX systems. > > Good catch.
At the risk of being overly pedantic, I've just added a configure test which checks for the size of a function pointer. I'm not convinced that you will still need to do a cast of this nature, Tim, but if you do, could you put throw something like the following: #if LIBMESH_SIZEOF_FUNCTION_POINTER != LIBMESH_SIZEOF_VOID_P std::cerr << "Appropriate error message." << std::endl; libmesh_error(); #endif in the code somewhere nearby? It just feels like a nasty bug waiting to happen otherwise... -- John ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
