delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/10/11/08:47:21

Date: Mon, 11 Oct 1999 14:17:06 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Andris Pavenis <pavenis AT lanet DOT lv>
cc: djgpp-workers AT delorie DOT com, DJ Delorie <dj AT delorie DOT com>
Subject: Re: xmalloc and xfree
In-Reply-To: <Pine.A41.4.05.9910110951410.100374-100000@ieva01.lanet.lv>
Message-ID: <Pine.SUN.3.91.991011141246.28578L-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, Andris Pavenis wrote:

> On 10 Oct 1999, Felix Natter wrote:
> 
> > "Kalum Somaratna" <kalum AT myflat DOT com> writes:
> > > Hi Felix,
> > > The header file wich contain's the definition is stdlib.h  as 
> > > documented in the doc's.
> > > 
> > >  #include <stdlib.h>
> > >  void *xmalloc(size_t size);
> > > 
> > > It is strange that you got the messages. I compiled your program 
> > > and it linked without any problems and I also didn't get any 
> > > undefined reference's.
> > 
> > did you also not get any warnings like "implicit declaration of ..." ?
> > because that's what I got with gcc-2.8.1, and now with gcc-2.95.1
> > it's getting an error message
> 
> Yes, now -ansi-pedantic is the default for C++ compiler. Current C++ 
> standard does not permit implicit declarations. Of course You can use
> command line option -fpermissive to get warnings instead of errors for 
> some standard violations. But I suggest to fix Your source better.

Perhaps we should uncomment the prototype of xmalloc and friends in 
stdlib.h, but only #ifdef __cplusplus.

Comments?

Btw, isn't that -ansi-pedantic default of C++ a good reason to complain 
about to the GCC maintainers?  As far as I understand, that means, in 
particular, that C++ programs will not see prototypes of non-ANSI 
functions in our C headers, right?  I guess there are other calamities 
as well.

Or maybe we should turn that switch off in specs?

- Raw text -


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