Re: [opensuse-kernel] Current kernel in Factory does not boot - master works
Hi, On Tue, 23 Feb 2010, Richard Guenther wrote:
On Tue, 23 Feb 2010, Jan Beulich wrote:
Richard Guenther <rguenther@suse.de> 23.02.10 15:35 >>> So that's a more convincing example to at least get consistency here. I'll open a bug, but please fix the kernel to use offsetof.
Yeah, I meanwhile got confirmation that this is going to be accepted upstream.
Hm, but it is all fine according to 6.6 and 6.7.5.2 - the fine reading differencing between integer constant expression and constant initializer.
Array sizes must be integer constant expression for the type to not be variably modified. All evaluated casts in integer constant expressions must convert arithmetic types to integer types. Pointer types are no arithmetic types. That's the catch which renders the whole thing invalid. Additionally (to Jan) 6.6/10 gives leeway only to accept other forms of constant expressions. Integer constant expressions are completely specified and are the ones that must be used in array lengths to make it not variably modified. Regarding the wish to not have to use stddef.h: that's premature. Even a freestanding conforming implementation (which means one that doesn't provide a full C library, exactly something that the kernel wants) is required to provide the <stddef.h> header. The kernel can make use of it, and probably is better off actually doing this, as ptrdiff_t, size_t and offsetof _are_ compiler specific. Unless the kernel wants to provide its own definitions for each compiler it wants to support, it better use the header that's designed for that. Ciao, Michael. -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
participants (1)
-
Michael Matz