From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 21 02:28:55 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5310616A4CE for ; Thu, 21 Apr 2005 02:28:55 +0000 (GMT) Received: from april.chuckr.org (april.chuckr.org [66.92.151.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id F170943D39 for ; Thu, 21 Apr 2005 02:28:54 +0000 (GMT) (envelope-from chuckr@chuckr.org) Received: from [66.92.151.195] (july.chuckr.org [66.92.151.195]) by april.chuckr.org (Postfix) with ESMTP id 8A27E11777; Wed, 20 Apr 2005 22:20:05 -0400 (EDT) Message-ID: <42670F63.4000901@chuckr.org> Date: Thu, 21 Apr 2005 02:26:43 +0000 From: Chuck Robey User-Agent: Mozilla Thunderbird 1.0 (X11/20050316) X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Leimbach References: <37e1316605042019072b5d7a0e@mail.gmail.com> <5bbfe7d4050420191316a629b7@mail.gmail.com> In-Reply-To: <5bbfe7d4050420191316a629b7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Aziz KEZZOU cc: hackers@freebsd.org Subject: Re: KLD module with C++ iostreams ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2005 02:28:55 -0000 David Leimbach wrote: > Interesting question. People usually have to implement the C++ > runtime to be usable from within the kernel. Things like exceptions > and "stdout" may not be defined in kernel space :) > > I'm not terribly familiar with how it works on FreeBSD but I know it > took a special effort to get C++ support into linux. > > Dave > > On 4/20/05, Aziz KEZZOU wrote: > >>Hi hackers, >>I am wondering if I can use c++ iostreams inside the kernel ? >>After all the code : cout << "Hello world!" << endl; >>ends accessing the stdout just like : printf("Hello world!\n"); right ? No, that's not true, all the iostreams stuff is totally independent. The iostreams stuff is coming from some of the ugliest code in C++. But, that's not the question, or at very least, it shouldn't BE the question. There is ZERO need to bring in features from C++, all it will do is to directly confuse the code base by greatly adding to the complexity of the code, without giving anything like equivalent features. Some very, very elegant work has been code, OO-ing the kernel code, adding OO features, all without violating the C language code base. Adding in C++ features over stdio stuff is so senseless, it's nearly obscene. If the gain at the end of the road was large enough, I wouldn't be against it so stridently, but I see *so* little gain. BTW, you know where the ugliest code in computer science today is: half is in the actual implementation of the cstdio/template code, the other half is the iostreams stuff. The fact that they energize some very elegant code is causing many folks never to see the fact of the horrible code lumps that exist out in the backyard. >> >>So if I could compile my KLD module with static linkage to libstdc++, >>that should be ok, right ? >> >>Any one did or knows how to do this ? >> >>Thanks, >>-aziz >>_______________________________________________ >>freebsd-hackers@freebsd.org mailing list >>http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >> > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"