🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #8

Re: delete [n] ptr warning

#8
From: Joe Buck
Date: Wed, 28 Oct 1992 23:39
32 lines
1528 bytes
In article <1992Oct28.221705.4235@cbnewsj.cb.att.com> troy@cbnewsj.cb.att.com (Troy Cauble) writes:
>g++ (2.2.2) warns me that the form
>
>	delete [n] ptr
>
>is anachronistic.  Is this true?  Says who?  That
>is, are the standards moving in that direction?

The ARM (Ellis and Stroustrup's Annotated C++ Reference Manual) says so.
The ANSI C++ standardization committee has adopted this as the base
document for the standard.

>Will ::operator delete() know to call multiple
>destructors in the array case?  Any pitfalls
>I should be aware of?

You must use the syntax
	delete [] ptr

The implementation is responsible for knowing how many objects there are.

>Forgive me if these are documented questions.  I don't
>have TeX, and have not figured out how to read any of
>the TeX based gcc/gdb documentation...

It's documented, but not in the Gnu documentation.  This is explained
in any up-to-date C++ book.  If you have an old one, you'll need to get
a new one.


--
Joe Buck	jbuck@ohm.berkeley.edu
Technical Details
Message-ID: <1cn8b3INN7n0@agate.berkeley.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!jvnc.net!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!sun-barr!ames!agate!forney.berkeley.edu!jbuck
References: <1992Oct28.221705.4235@cbnewsj.cb.att.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!jvnc.net!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!sun-barr!ames!agate!forney.berkeley.edu!jbuck
From: jbuck@forney.berkeley.edu (Joe Buck)
Newsgroups: gnu.g++.help
Subject: Re: delete [n] ptr warning
Date: 28 Oct 1992 23:39:15 GMT
Organization: U. C. Berkeley
Lines: 32
Message-ID: <1cn8b3INN7n0@agate.berkeley.edu>
References: <1992Oct28.221705.4235@cbnewsj.cb.att.com>
NNTP-Posting-Host: forney.berkeley.edu