[openbeos] Re: C++ in the kernel

  • From: "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Sun, 23 Feb 2003 23:18:56 +0100 CET

"Axel Dörfler"  <axeld@xxxxxxxxxxxxxxxx> wrote:
> "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx> wrote:
> [...]
> > The second newsletter article Charlie was referring to is a good 
> > introduction (does anybody know, where to get the sample code?). 
> > I'd 
> > like to have more details, though. I've been trying for months to 
> > convince Axel to write an article, but he's just too lazy. ;-)
> 
> Yes, I am :-)
> You don't have to convince me to write one, because I wanted to do 
> that 
> anway, it's just that I need to find the time to do so :-)

Uh, I've always considered that a lame excuse of yours. ;-)

> > You might also want to have a look at src/add-ons/kernel/
> > file_systems
> > /
> > bfs/cpp.{h,cpp}.
> > I think, cpp.cpp should be linked into the kernel and cpp.h made 
> > available as public kernel header.
> 
> As long as we don't create a dependence on a specific compiler 
> version, 
> I agree with you here. OTOH that step would require a newsletter ;-)

:-)

[...]
> > > And here are a couple I'm specifically curious about:
> > > - new and delete
> > No problem. The operators have to be overridden as in cpp.h. I 
> > dislike 
> > the `#define new new (_dontthrow)' there, though. And I don't think 
> > `extern nothrow_t _dontthrow;' is needed, for `nothrow' should be 
> > defined anyway.
> 
> Yes, you are right "nothrow" is already defined and works okay (will 
> update it shortly).
> What would you suggest to replace the #define with?

Remove it completely, I would say. As the brave userland coders do, one 
can use the nothrow variant explicitly. Or override the non-nothrow 
versions as well -- I'm not even sure, if that is necessary, since we 
compile with `-fno-exceptions' anyway.

CU, Ingo


Other related posts: