[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0703090938450.10832@woody.linux-foundation.org>
Date: Fri, 9 Mar 2007 09:47:47 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Christoph Hellwig <hch@...radead.org>
cc: Rusty Russell <rusty@...tcorp.com.au>,
lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] Use more gcc extensions in the Linux headers
On Fri, 9 Mar 2007, Christoph Hellwig wrote:
>
> It was only put in under the premise that they'll fix whatever breaks,
> we're not going to put any maintaince border on us to hack around
> broken propritary compilers.
Well, since Rusty's macro was hoddible *anyway*, I don't think I'd apply
it as-is. Breaking icc for something that ugly and not-very-important
simply makes no sense.
There are better ways to do this.
For one, you could (and should!) abstract these kinds of things out,
rather than put them in another macro that really does something totally
different. Then, the macro could have become
#define ARRAY_SIZE (sizeof_expression + 0*error_if_not_array)
which would already be a hell of a lot more readable. But more
importantly, it's also now suddenly much easiler to abstract out for
different compilers.
We *already* support different compilers through <linux/compiler.h>, and
there just isn't any reason for bad code just for bad codes sake!
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists