Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: Comparison functions for qsort() and bsearch() Keywords: Sun, C++ Message-ID: <60328@microsoft.UUCP> Date: 7 Jan 91 22:56:41 GMT References: <3069@lupine.NCD.COM> <277640DD.4A70@tct.uucp> <1990Dec26.160636.15566@clear.com> <1991Jan2.191630.18581@Think.COM> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 36 ARM pg 36 states that a pointer to any non-const, non-volatile object type can be converted to a void* ARM pg 69 states that a void* is considered a pointer to object type. ARM pg 69 states that a B* can be converted to a D* if an unambiguous conversion exists and B is not a virtual base. ARM pg 67 states that any conversion not mentioned on pgs 67 to 71 is an error. ARM pg 68 states that if you haven't yet defined a class, you can use it in a pointer cast, in which case "no assumptions are made about class lattices." I leave it to the reader how a compiler performs such a cast without making any assumptions -- perhaps a random number is to be generated for the results of such a cast? ARM pgs 67-71 do not otherwise cover possible explicit conversions from a void* to a pointer to an object of some class. Therefor, I claim either: 1) Casts from a void* to a pointer to an object of some class already defined are in error. or 2) The definitions given by ARM pgs 67-71 are in error. and either: 3) No assumptions may be made about casts from a void* to a pointer to an object of a class not yet defined. or 4) The definitions given by ARM in these regards are in error.