On Wed, 5 Oct 2005, nobuyoshi nakada wrote:
> I'd have to say "portability safety (or strictness)."  Calling
> funcion pointer, casting differently from original definition,
> could prevent a complier from conversions possibly required by
> implicit casts.  Casted result doesn't always equal bitwise
> re-interpreted result on all platforms.

However, the default cast is a reinterpret_cast at least on all pointers, 
except on 16-bit MSDOS (where qualifiers near,far,huge may matter).

Also, sizeof(long)==sizeof(any*) except on MSDOS where near* is smaller 
but far* and huge* are bigger.

AFAIK, Ruby never ever ran on 16-bit MSDOS, and instead Ruby for MSDOS
uses a 32-bit mode loader with a custom version of GCC called DJGPP.

Also, function pointers can be cast from one type to another without 
modification and be used as long as the type it's used as is sufficiently 
compatible with the original type. The situation is slightly different in 
C++ but only when templates or compile-time polymorphism are involved.

Anyone knows any exception to what I've said? Any case I'm missing?

____________________________________________________________________
Mathieu Bouchard - tñÍ:+1.514.383.3801 - http://artengine.ca/matju
Freelance Digital Arts Engineer, MontrñÂl QC Canada