This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Re: Wrong destruction order of static objects in g++
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: [patch] Re: Wrong destruction order of static objects in g++
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 07 Jun 1998 16:52:56 -0300
- Cc: rth at cygnus dot com, Klaus-Georg dot Adams at chemie dot uni-karlsruhe dot de, egcs-bugs at cygnus dot com, egcs-patches at cygnus dot com, jkanze at otelo dot ibmmail dot com
- References: <199806071732.NAA29584@caip.rutgers.edu>
Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:
>> From: Alexandre Oliva <oliva@dcc.unicamp.br>
>> Richard Henderson <rth@dot.cygnus.com> writes:
>> > Don't forget to exit(0).
>> There's no need for that in C++. Falling off main() is equivalent to
>> returning zero.
> Also, doesn't calling exit(0) bypass destructors?
Only destructors of automatic objects are bypassed. Other than that,
returning from main must be equivalent to calling exit(), as stated in
[basic.start.main]/5
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil