Re: Object Oriented Linux

From: Tom Leete (tleete@mountain.net)
Date: Thu Jul 13 2000 - 04:10:21 EST


[Cc. trimmed]

Andrew Morton wrote:
>
> Khimenko Victor wrote:
> >
> > Kernel lacks suppot for rtti and exceptions.

Why would anybody expect C code to catch exceptions? Define
an unexpected_handler, then:

extern "C" int sys_func() // user context
throw()
try {
        //do things
        return 0;
}
catch( std::bad_alloc e)
{
        return -ENOMEM;
}
catch( etc)
{
        return -ETCETERA;
}

>
> I'm sorry, Victor but this one gets under my skin. If people want to
> write kernel code in C++ well good for them. All it requires of the
> kernel developers is to take the darn C++ keywords out of the headers.
> About an hour's work for someone who has a license for /bin/vi.

Been there, done that, got the hairshirt. ;-)

The patch was huge (730k) and nearly all trivial. Takes more
than an hour if you're careful about not changing language
in comments.

The resulting kernel ran just fine.
 
> This is an ideological language war masquerading as a technical and
> supportability issue.

Yup. C99 'inline' is going to break things. Storage class
modifiers are plain out. They should continue to work for
gcc keyword __inline__.

Cheers,
Tom

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



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:16 EST