DragonFly BSD
DragonFly kernel List (threaded) for 2005-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: setjmp/lonjmp (was: vinum warning)


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Fri, 4 Feb 2005 00:40:05 +0100
Mail-followup-to: kernel@crater.dragonflybsd.org

On Fri, Feb 04, 2005 at 09:35:16AM +1030, Greg 'groggy' Lehey wrote:
> > They destroy the normal flow of code.
> 
> For your definition of "normal".

Well, I very much like calling graphs which are shaped like trees.
Such a tree makes it very easy to follow the code. Recursion needs
special care and has to be checked. Passing error codes up the same
path the code took down makes it easy to verify what errors can come
from where. This is what I consider "normal". C++-style exceptions
can simplify code, but remove this explicit control flow, which might
be a good idea for large scale userland applications, but IMO is
not good for the kernel.

> > Even worse, they allow jumping out of the current flow to a
> > different stack.
> 
> There are plenty of constructs that can be abused.  Vinum doesn't do
> this.

Well, I would call vinum_scandisk calling setjmp and afterwards
calling parse_config, which can itself call vinum_scandisk, at least
dangerous.

Joerg



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]