Beginning C++ in FreeBSD

Sergey Zaharchenko doublef at tele-kom.ru
Wed Apr 28 19:24:15 PDT 2004


On Wed, Apr 28, 2004 at 12:42:29PM -0500,
 Jonathan Lemon probably wrote:
> I knew there was a good reason why I redirected -chat to /dev/null,
> and I'm going to restore that procmail rule in about 30 seconds.
> 
> However, before I do that, I'll note this entire conversation is 
> utterly stupid.  That "feature" of C++ initializers being called 
> on startup is simply from lib/csu/i386/c++rt0.c (or equivalent);
> if you really wanted the same feature in C, you'd write your own
> crt0.c and then call gcc with "-nostartfiles"
> 
> If you don't want "main()" as your entry point, use "ld -e myfunc" instead.

Sure, that's really good (though you could just write your own _init()
in your source and call gcc with -nostdlib) --- but I wanted it be
portable (that's what the discussion is actually above). So you're
cheating:).

-- 
DoubleF
The law will never make men free; it is men who have got to make the
law free.
		-- Henry David Thoreau
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-chat/attachments/20040429/f244bed1/attachment.bin


More information about the freebsd-chat mailing list