lkml.org 
[lkml]   [2004]   [Jun]   [3]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 3 Jun 2004 08:55:21 +0200
FromJörn Engel <>
SubjectRe: [RFC PATCH] explicitly mark recursion count
On Wed, 2 June 2004 20:59:44 +0100, viro@parcelfarce.linux.theplanet.co.uk wrote:
> > 
> > Ok.  Would it be ok to use the following then?
> > 
> > b1. Function pointer are passed as arguments to functions and
> > b2. those pointer are called directly from the function, they are
> >     passed to.
> 
> Again not guaranteed to be true - they can be (and often are) passed further.

Hmm.  If that happens, I'm out of ideas for now.  Cannot do more than
give a warning.

> Moreover, they are also stored untyped in structures.  Common pattern
> is
> 	foo.callback = f;
> 	foo.argument = p;
> 	iterate_over_blah(blah, &foo);
> 
> Note that here f is the only thing that will see the value of p _and_ the
> only thing that cares about type of p.  iterator itself doesn't care and
> can be used for different types.

Those cases I should already catch.  If foo is of type "struct bar",
"bar.callback" will be the function name for a pseudo-function.  That
function is called by iterate_over_blah and calls f.  Unnamed struct
get a name made up from the components of the struct, like
____FAKE.Name.Chip.stat.Regi.LILP.Opti.high.lowe->ProcessIMQEntry.
Doesn't look pretty, but works.
Jörn

-- 
Time? What's that? Time is only worth what you do with it.
-- Theo de Raadt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [from the cache]
©2003-2008