login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
March
»
31
Re: Sparse Question
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Harvey Harrison
Subject:
Re: Sparse Question
Date: Monday, March 31, 2008 - 3:07 pm
On Mon, 2008-03-31 at 22:58 +0100, Al Viro wrote:
quoted text
> On Mon, Mar 31, 2008 at 02:39:58PM -0700, Harvey Harrison wrote: > > On Mon, 2008-03-31 at 14:15 -0700, Harvey Harrison wrote: > > > Hi Al, > > > > > > Further to eliminating some of the trivial sparse noise in a kernel > > > build, I just can't seem to understand what sparse is warning about: > > > > > > > I should have mentioned, the other block of warnings comes from > > drivers/media/video/videodev.c....again initializing arrays of IOCTLs > > 1 ? 0 : x > > is not valid in contexts where C requires integer constant expressions. > Index in static array initializer is one of those. > > gcc allows it, but its extensions in that area are inconsistent, to say > the least - basically, it goes with "if optimizer can fold that into > constant with this set of options, it will be accepted". With very weird > boundary between accepted and not accepted (as in "reorder arguments of +, > and what had been recognized as constant is not recognized anymore"). > > sparse doesn't even try to duplicate that set of bugs. We _could_ try > to go for a more or less reasonable subset (e.g. ?: with integer constant > expression as the first argument and integer constant expression as > the second or the third resp., depending on the value of the first one, > similar for && and ||), but I'm not all that sure that it's worth doing. > > The fact is, use of what we have for _IOC in such contexts is not just > a gccism, it's ill-defined one. I suspect that the right solution is > to sanitize _that_... > > FWIW, why not simply put division by 0 into the branch that shouldn't > be reached instead of using a variable that doesn't exist and would > blow at ld(1) time? I.e. go with > #define _IOC_TYPECHECK(t) \ > ((sizeof(t) == sizeof(t[1]) && \ > sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ > sizeof(t) : 1/0) > instead. I'd say that trading a pretty name in linker stderr for > compiler error that shows exact location in the source would be > a good bargain... > > Linus, would you object against that in post-2.6.25?
Sorry, maybe I'm thick, but how does _IOC_TYPECHECK get pulled into the _IOC_NR use? Harvey --
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
Re: Sparse Question
, Al Viro
, (Mon Mar 31, 2:58 pm)
Re: Sparse Question
, Harvey Harrison
, (Mon Mar 31, 3:07 pm)
Re: Sparse Question
, Harvey Harrison
, (Mon Mar 31, 3:16 pm)
[PATCH] asm-generic: suppress sparse warning in ioctl.h
, Harvey Harrison
, (Mon Mar 31, 3:26 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ken Chen
[patch] sched: fix inconsistency when redistribute per-cpu tg->cfs_rq shares.
Nick Piggin
Re: [PATCH 2/2] smp_call_function: use rwlocks on queues rather than rcu
Kyle Moffett
Re: [PATCH 1/4] stringbuf: A string buffer implementation
Ingo Molnar
Re: [PATCH 00/12] mm/x86: bootmem
Andrew Morton
Re: [patch 1/5] wait: use lock bitops for __wait_on_bit_lock
git
:
Stephen Boyd
Re: [PATCH] Speed up bash completion loading
Jakub Narebski
Re: Avery Pennarun's git-subtree?
Junio C Hamano
Re: [PATCH v2 04/13] Teach rebase interactive the mark command
Catalin Marinas
Re: [ANNOUNCE] Stacked GIT 0.14.2
Eric Wong
[PATCH 5/5] rerere: add the diff command
git-commits-head
:
Linux Kernel Mailing List
[POWERPC] fsl_soc: add support to gianfar for fixed-link property
Linux Kernel Mailing List
fat: fix parse_options()
Linux Kernel Mailing List
ipmi: add oem message handling
Linux Kernel Mailing List
powerpc/85xx/86xx: Fix build w/ CONFIG_PCI=n
Linux Kernel Mailing List
KVM: x86 emulator: during rep emulation decrement ECX only if emulation succeeded
linux-netdev
:
Paweł Staszewski
Re: DCA/IOAT problem
Jarek Poplawski
Re: [PATCH iproute2] Re: HTB accuracy for high speed
Ingo Oeser
Re: [NET-NEXT PATCH 3/3] e1000e: add support for new 82574L part
Rick Jones
Re: UDP path MTU discovery
Dmitry Kozlov
Re: [PATCH v8] PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)
openbsd-misc
:
David Vasek
Re: how to undelete?
Gruppo BCC
Banca inviato una notifica che e necessario completare
Pau Amaro-Seoane
Re: First install: Grub doesn't find partitions
Nick Holland
Re: Unattended OpenBSD Installation
stuart van Zee
Re: CVS hosed
Colocation donated by:
Syndicate