David Holmes writes: > Well if we're being pedantic and imprecise to boot ... > > > >> malloc() returns a char*, not a jbyte*. > > malloc() returns void* not char*. It hasn't returned char* since pre ANSI C.
True, yes. > Hence the pointer returned by malloc can be legally converted to any real > pointer type with clearly defined semantics. > Taking the address of a void* and pretending that it is the address of a > jbyte* is not legal. However, it is legal to convert between an int and a > pointer type and a pointer type and an int. If the address represented by > the int is incorrectly aligned for the pointer type then the result is > undefined. Otherwise the result is implementation specific. Hence you can > write legal but (by definition) non-portable code to do what you want. No, because of aliasing rules. You can't convert a pointer between two types that are not character types and then dereference it. Andrew. _______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath

