Mail Archives: djgpp-workers/1999/10/12/04:28:45
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 -