Article View: net.lang.c++
Article #230Cornell Bug Report #1 of 3
From: Gene Dykes
Date: Thu, 19 Jun 1986 14:44
Date: Thu, 19 Jun 1986 14:44
40 lines
1472 bytes
1472 bytes
The "duplicate destructor" problem...
- - - - - - -
class
c_dbg {
c_dbg() ;
~c_dbg() ;
} ;
main()
{
void f() ;
f() ;
}
void
f()
{
c_dbg dummy ;
return ;
}
- - - - - -
The above construct when compiled by CC results in the warning...
"line 16: warning: statement not reached"
I have a class that uses this construct in lots of functions, so I have
to suffer through this warning endless times. It's by no means a fatal
bug, but certainly annoying.
(A look at the code produced shows that the destructor is declared, invoked,
then the function returns, and then the destructor is called again, and
it is this second call which can't be reached since it is just after
the return statement.)
--
Gene Dykes, 120 Rand Hall, Cornell U., Ithaca, NY 14853 (607)255-6713
{ihnp4,decvax,allegra,vax135}!cornell!batcomputer!gdykes
Technical Details
Message-ID:
<499@batcomputer.TN.CORNELL.EDU>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!ut-sally!seismo!rochester!bullwinkle!batcomputer!gdykesShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!ut-sally!seismo!rochester!bullwinkle!batcomputer!gdykes From: gdykes@batcomputer.TN.CORNELL.EDU (Gene Dykes) Newsgroups: net.lang.c++ Subject: Cornell Bug Report #1 of 3 Message-ID: <499@batcomputer.TN.CORNELL.EDU> Date: Thu, 19-Jun-86 10:44:53 EDT Article-I.D.: batcompu.499 Posted: Thu Jun 19 10:44:53 1986 Date-Received: Sun, 22-Jun-86 03:06:33 EDT Reply-To: gdykes@batcomputer.UUCP (Gene Dykes) Organization: Theory Center, Cornell University, Ithaca NY Lines: 40