[ale] Doubt about c++ driver in linux.

Prabhu Kubendran prabhu.kubendran at wipro.com
Sat Oct 6 05:59:32 EDT 2001



On Fri, 5 Oct 2001, Steven A. DuChene wrote:

> Date: Fri, 5 Oct 2001 14:00:28 -0400
> From: Steven A. DuChene <linux-clusters at mindspring.com>
> To: Joseph A Knapka <jknapka at earthlink.net>
> Cc: ale at ale.org
> Subject: Re: [ale] Doubt about c++ driver in linux.
> 
> On Fri, Oct 05, 2001 at 11:37:54AM +0000, Joseph A Knapka wrote:
> > Prabhu Kubendran wrote:
> > >         we are compiling c++ driver code in linux kernel 2.4.2. we have
> > > included string.h file in /usr/src/linux/include/asm. we are using strlen
> > > function in our code. when we compile the code it gives lots of warnings
> > > and a segmentations fault in string.h file @ ln no 187. if we remove the
> > > static it works fine. we are using gcc as c++ compiler.
> > > 
> > > The exact error message is
> > >         "Internal error: Segmentation fault in string.h @line 187"
> > 
> > For a number of reasons, using C++ in the kernel is a
> > Bad Idea. The kernel intentionally supplies an
> > extremely minimal runtime environment, and C++ code
> > depends on a number of runtime niceties that are not
> > supported by the kernel. Among those are initialization
> > of static objects with constructors, which may be the
> > root of your problem.
> > 
> > Please read this URL:
> > 
> > <URL: http://kt.linuxcare.com/kernel-traffic/kt20000507_66.epl#7>
> > 
> 
> Dude! Most excellent answer and a very interesting write-up for everyone
> to read.
> 

	ya we accept that it is a bad idea to use c++ in kernel. But since
most of our development has beed done in c++ earlier, we have to stick on
to c++. Is there any solution to solve this problem (static inline
functions ).




---
This message as been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list