From -6171959139888314633
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,27b216646bf2abb1
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1991-03-07 12:53:43 PST
Path: gmdzi!unido!mcsun!uunet!spool.mu.edu!news.cs.indiana.edu!msi.umn.edu!cs.umn.edu!ux.acs.umn.edu!vx.acs.umn.edu!dhoyt
From: dhoyt@vx.acs.umn.edu (DAVID HOYT)
Newsgroups: comp.std.c++
Subject: Re: Conversions to/from void*, redux
Keywords: Sun, C++
Message-ID: <3568@ux.acs.umn.edu>
Date: 7 Mar 91 16:15:40 GMT
References: <70935@microsoft.UUCP> <27D18D22.1608@tct.uucp> <71031@microsoft.UUCP> <27D5708A.29CF@tct.uucp>
Sender: news@ux.acs.umn.edu
Reply-To: dhoyt@vx.acs.umn.edu
Organization: University of Minnesota, Academic Computing Services
Lines: 21
Posted: Thu Mar  7 10:15:40 1991
News-Software: VAX/VMS VNEWS 1.3-4

In article <27D5708A.29CF@tct.uucp>, chip@tct.uucp (Chip Salzenberg) writes...
> ... about void* equivalent to char*
>Since ANSI C++ will be based on ANSI C, I find myself hard-pressed to
>imagine a rationale for breaking it under ANSI C++.

  The reason that ANSI made this true (mostly, anyway) is because there
existed a huge body of code that depended on this equivalence.  Remember
K&R didn't have a void type in the first place.  This forces word machines,
such as the Cray's, either 1) always create slow code, or 2) supply a
compiler switch to produce slow (but compatable) code or create code
that is fast, but will break some code that makes stupid assumptions
about void* == char*.

  But with C++ this is not the case.  Anyone who has used a char* when
a void* was needed was in no simple terms, stupid.  I would like to think
that the grand majority of code out there in C++ doesn't make this mistake.
So there is no good reason to support this equivalence in C++.  The standard
should declare such code to be buggy and let the language implementor's the
freedom to produce the best possible code for their target machines.

  But what do I know?  -- david | dhoyt@vx.acs.umn.edu


