Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!wuarchive!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.std.c++ Subject: aliases, ptr coercions, and optimizations Message-ID: <56170@microsoft.UUCP> Date: 30 Jul 90 19:50:35 GMT Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 15 Request for Clarification and a General Proposal: I claim there is a need for clarification in terms of what kinds of ptr casts are legal in the face of an optimizing compiler. For example, does: foo* fooptr = &(bar.fooMember); poison fooMember, the labeled section fooMember is in, the class derivation that fooMember is in, or all of bar? My general proposal is that C++ be very restrictive in terms of what pointer casts are "guaranteed" to work, allowing for maximum compiler optimizations, while minimizing the pointer hacks that are "guaranteed" to work. IE, good C++ citizens should get well optimized code, but C++ hacker code may not work at all.