🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #916

Re: Conversions to/from void*, redux

#916
From: DAVID HOYT
Date: Thu, 07 Mar 1991 16:15
21 lines
1853 bytes
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
Technical Details
Message-ID: <3568@ux.acs.umn.edu>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!spool.mu.edu!news.cs.indiana.edu!msi.umn.edu!cs.umn.edu!ux.acs.umn.edu!vx.acs.umn.edu!dhoyt
References: <70935@microsoft.UUCP> <27D18D22.1608@tct.uucp> <71031@microsoft.UUCP> <27D5708A.29CF@tct.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!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
News-Software: VAX/VMS VNEWS 1.3-4