| From: Lennart Sorensen <[email protected]> | So did their compiler explicitly handle a cast of a 0 value integer to | a pointer and map it to the "correct" null pointer address value? | | That seems horribly complicated to manage.
Almost always an int to pointer conversion involves a literal 0. Easy. Almost no pointers (literal or otherwise) are converted to int. The part of the standard you quoted refers to a literal 0. Casting a non-0 literal integer to a pointer type is rare. Using -1 as a second in-band signal happened sometimes in old code. Casting a non-literal integer to a pointer is not often meaningful. Or vice-versa. It is not common. But it is legal. It is usually a sign of a broken program. Really low-level programs may do pointer arithmetic with some integral type. The standard imposes no requirements on this. It is as easy to handle this conversion as it is to handle casting an int to a float. From a compiler standpoint, it takes code, not just painting a new type on the old value. Since this is rare, who cares? _______________________________________________ Swan-dev mailing list [email protected] https://lists.libreswan.org/mailman/listinfo/swan-dev
