Re: type safe lists (was Re: PATCH: type safe(r) list_entry repacement: generic_out_cast)

John Alvord (jalvo@mbay.net)
Wed, 24 Jul 2002 09:49:13 -0700


On Wed, 24 Jul 2002 13:58:50 +0200, Jakob Oestergaard
<jakob@unthought.net> wrote:

>On Wed, Jul 24, 2002 at 12:50:28PM +0200, Martin Brulisauer wrote:
>...
>> So it is.
>>
>> At kernel level nothing will stop me to halt() the cpu, if I realy want
>> to. It is important to understand that tools (and all compilers are
>> just tools) will not enable me to write correct code.
>
>That is a lame argument.
......
>Macros are not a pretty solution, but it is as I see it the only way to
>achieve type safety in generic code. If someone else out there has
>other suggestions, please let me know - I actually like to be proven
>wrong (because that means I learn something new).
>
>I'd take macro-hell in generic code over void* hell in every single
>list-using part of the kernel any day.

There was a similar flare-up about a year ago when type safety was
added to the min and max macros. The initial implementation was a bit
strange, but the final one used some gcc-ism and now no one complains.

john alvord

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