Thread View: net.lang.c++
1 messages
1 total messages
Started by Gene Dykes
Thu, 19 Jun 1986 14:44
Cornell Bug Report #1 of 3
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads