lkml.org 
[lkml]   [2008]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 5/5] typesafe: TIMER_INITIALIZER and setup_timer
Date
On Tuesday 05 February 2008 14:41:53 Rusty Russell wrote:
> On Tuesday 05 February 2008 01:57:37 Al Viro wrote:
> > On Mon, Feb 04, 2008 at 11:19:44PM +1100, Rusty Russell wrote:
> > > This patch lets timer callback functions have their natural type
> > > (ie. exactly match the data pointer type); it allows the old "unsigned
> > > long data" type as well.
> > >
> > > Downside: if you use the old "unsigned long" callback type, you won't
> > > get a warning if your data is not an unsigned long, due to the cast.
> >
> > No. There's much saner way to do that and it does not involve any
> > gccisms at all. I'd posted such patches quite a while ago; normal C
> > constructs are quite sufficient, TYVM.
>
> If you're referring to your 1 Dec 2006 posting, it was enlightening, but I
> was unable to find any patches.

No reply? I'll try again now.

> > No. There's much saner way to do that and it does not involve any
> > gccisms at all.

Except typeof, you mean?

> > I'd posted such patches quite a while ago

AFAICT you posted an untested code fragment which won't actually compile
because the callback in this case returns void.

> > ; normal C constructs are quite sufficient, TYVM.

Your code didn't check the return type, except that it's a pointer or
int-compatible. We can do better, as this patch showed.

If you have a "saner way" of doing this in general which is just as effective,
I look forward to it. Otherwise you're just managed to delay these
improvements for another release.

Rusty.


\
 
 \ /
  Last update: 2008-03-05 03:59    [W:2.900 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site