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

Joseph A Knapka jknapka at earthlink.net
Fri Oct 5 07:37:54 EDT 2001


Prabhu Kubendran wrote:
> 
> hi,
>         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>

HTH,

-- Joe
# "You know how many remote castles there are along the
#  gorges? You can't MOVE for remote castles!" - Lu Tze re. Uberwald
# Linux MM docs:
http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html

---
This message as been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info






More information about the Ale mailing list