Re: 2.1.127pre2

Richard Gooch (rgooch@atnf.csiro.au)
Wed, 28 Oct 1998 08:41:30 +1100


Linus Torvalds writes:
>
>
> On Mon, 26 Oct 1998, David S. Miller wrote:
> >
> > Linus, can we have a "rwlock_init()" just like we do for spinlocks so
> > functions can initialize rwlock's in this manner without the compile
> > bombing on non-SMP because it will in turn from:
> >
> > tmp->foo_rwlock = RWLOCK_INIT;
> >
> > end up seeing:
> >
> > tmp->foo_rwlock = { };
> >
> > which last time I checked is not legal C :-)
>
> No, we should do it as
>
> tmp->foo_rwlock = (rw_lock_t) RWLOCK_INIT;
>
> which is legal gcc.

But gross. Having to do that when you use RWLOCK_INIT is ugly. What
about putting the cast into the macro itself?

Regards,

Richard....

-
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/