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

Steven A. DuChene linux-clusters at mindspring.com
Fri Oct 5 14:00:28 EDT 2001


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.
-- 
Steven A. DuChene      linux-clusters at mindspring.com
                      sduchene at mindspring.com

        http://www.mindspring.com/~sduchene/

---
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