Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.micro,net.lang Subject: Re: Unchecked conversion in Ada Message-ID: <2323@sun.uucp> Date: Thu, 20-Jun-85 01:07:45 EDT Article-I.D.: sun.2323 Posted: Thu Jun 20 01:07:45 1985 Date-Received: Sat, 22-Jun-85 23:46:52 EDT References: <1649@reed.UUCP> <186@harvard.ARPA> <453@calmasd.UUCP> <192@harvard.ARPA> <266@sdcc13.UUCP> <197@harvard.ARPA> Organization: Sun Microsystems, Inc. Lines: 19 Xref: watmath net.micro:10833 net.lang:1624 > a function which converts between any two types bit-to-bit; something > like C's casts. C casts are not bit-for-bit conversions unless the conversion happens to be implemented as such. This is the case for signed <-> unsigned conversions on two's complement machines, pointer <-> integer conversions, and pointer <-> pointer conversions in most cases on byte-addressible machines. C compilers don't complain about conversions between pointers of different types, nor do they complain about various other type conversions. "lint" will complain about more of them. I've found bugs in kernel code I've written that would have been found by "lint" (for those of you who think strong type checking is a Bad Thing in system code). Note that the idea of bit-for-bit conversion operators dates back to PL/I's "unspec" (which, like PL/I's pointers, was typeless); Mesa has a bit-for-bit type conversion operator "loophole" similar in concept to Ada's. Guy Harris