Re: [Criticism] On the discussion about C++ modules

From: Peter Samuelson (peter@cadcamlab.org)
Date: Tue Oct 17 2000 - 02:11:36 EST


[Eray Ozkural]
> I can't say whether putting libstdc++ in a kernel module is a bad thing
> before I see one. This is a skel. code:

> -rw-r--r-- 1 root root 271528 Oct 10 09:54 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so
> orion:opt$ ls -al /usr/lib/libstdc++-3-libc6.2-2-2.10.0.a
> -rw-r--r-- 1 root root 476494 Oct 10 09:54 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.a

Don't forget to include libc.so here -- you know libstdc++ won't run
without it. Let's see ... Debian-unstable glibc 2.1.95 here ...

-rwxr-xr-x 1 root root 1057576 Oct 13 13:45 /lib/libc.so.6
-rw-r--r-- 1 root root 2445036 Oct 13 13:47 /usr/lib/libc.a

Heh.

> > - <const &> args : dont break your untouchable data, and get rid of pointer mess
>
> and const functions. This is such a good thing, it allows the
> compiler to make great optimizations that are not possible in C. The
> C9x standards had (IIRC) a similar "restricted" keyword for C, but I
> don't know if gcc is going to implement it. You might want to demand
> that from gcc developers :)

Is this similar to the gcc 'const' attribute?

  int foo (int, char *) __attribute__((__const__));

This is valid in GNU C (not just C++). Read the info page for
details. As to the pass-by-reference operator, that's just syntactic
sugar and IMHO the information-hiding makes more trouble than it's
worth (I want to *know* I'm passing by reference!).

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:10 EST