This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: warning with gcc 2.95.1


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]