On Tue, 23 Feb 2010, Richard Guenther wrote:
On Tue, 23 Feb 2010, Jan Beulich wrote:
> Richard Guenther <rguenther(a)suse.de>
23.02.10 15:35 >>>
So that's a more convincing example to at least get
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
Hm, but it is all fine according to 6.6 and 126.96.36.199 - the fine
reading differencing between integer constant expression and
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.
To unsubscribe, e-mail: opensuse-kernel+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-kernel+help(a)opensuse.org