Re: exit & return
From: Kevin Goodsell (usenet2.spamfree.fusion_at_neverbox.com)
Date: Tue, 23 Mar 2004 23:01:02 GMT
Stephen Sprunk wrote:
> "Richard Heathfield" <firstname.lastname@example.org> wrote in message
>>My understanding (which may be flawed) is that global objects need to be
>>constructed exactly once, and that it is common for compilers to sneakily
>>insert constructor calls at the beginning of main(). Recursing into main()
>>would mean that these constructors get called N times instead of just
>>which would be Bad. (The analogous argument applies to destructors at the
>>other end of the process, I guess.)
>>Ask in comp.lang.c++ if you care enough to want a likely-to-be-correct
> I thought global objects were constructed in _start and destructed in _end.
No such functions exist, as far as the standard is concerned. A
particular implementation could reasonably do it that way (as far as I
can tell), but it's not mandated by the standard.
-- My email address is valid, but changes periodically. To contact me please use the address from a recent posting.