delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/10/12/04:28:45

Date: Tue, 12 Oct 1999 09:31:34 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Re: xmalloc and xfree
In-Reply-To: <199910111721.NAA25761@envy.delorie.com>
Message-ID: <Pine.SUN.3.91.991012093116.7576B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 11 Oct 1999, DJ Delorie wrote:

> I'm concerned that adding the prototype will cause more trouble than
> it's worth.  If C++ programs are supposed to use new/delete anyway,
> why is the prototype needed at all?

The prototype is needed because some user, like the one who started
this thread on c.o.m.d., might use xmalloc.  It's considered a Bad
Idea in C++, but users should be entitled to compile their Bad Ideas
and sustain the consequences.

The difference between this case and the C case (where I do think the
prototype should be invisible) is that (a) C programs compile and link
while C++ programs do not, and (b) the potential problems from
incompatible xmalloc prototypes in ported C++ programs should be very
rare (assuming that Serious Programmers who write C++ programs that
people would port know better than to use xmalloc).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019