This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning with gcc 2.95.1
- To: Jean-François MORCILLO <Jean-Francois.Morcillo@steria.fr>
- Subject: Re: warning with gcc 2.95.1
- From: Nathan Sidwell <nathan@acm.org>
- Date: Wed, 18 Aug 1999 14:10:11 +0100
- CC: Joe Buck <jbuck@synopsys.COM>, gcc@gcc.gnu.org
- Organization: University of Bristol
- References: <199908181222.FAA23677@atrus.synopsys.com> <37BAA90F.3A4573D9@steria.fr>
- Reply-To: nathan@compsci.bristol.ac.uk
Jean-Frangois MORCILLO wrote:
> the code look like this :
> void my_delete(void *adr)
> {
> //some stuff
> ...
> //free memory
> delete adr ;
> }
>
> in the C++ Programming Lanhuage Third edition, le the prototype for operator delete is the
> same....
[expr.delete] 5.3.5/2
'... the pointer shall be a pointer to a non-array object ...'
void * is not a pointer to object. Your code is incorrect. You might mean
operator delete (adr);
which _is_ different.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk