[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.00.0804021752040.14670@woody.linux-foundation.org>
Date: Wed, 2 Apr 2008 17:57:54 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Harvey Harrison <harvey.harrison@...il.com>
cc: Al Viro <viro@...IV.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 7/7] asm-generic: suppress sparse warning in ioctl.h
On Wed, 2 Apr 2008, Harvey Harrison wrote:
>
> 1 ? 0 : x
>
> is not valid in contexts where C requires integer constant expressions.
> Index in static array initializer is one of those.
So I don't much like this one, because (a) we could just make sparse
accept it and (b) gcc _does_ accept it and gives us nicer error messages.
Well, maybe "nicer" is wrong (because it's a link-time one), but at least
not a _totally_ misleading one.
What does "division by zero" mean as an error message? Also, if I recall
correctly, last time we tried something like this (admittedly long ago),
some compilers would actually make it a run-time error, not a compile-time
one - it would simply refuse optimize the 1/0 into a value at all, and
just generate a run-time divide.
So I'm not even sure that all versions of gcc will even complain at all
(although it might have been icc).
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