[lkml]   [2001]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: sizeof problem in kernel modules
"Richard B. Johnson" <> writes:

> This means that it must be some place else than where it's denoted
> in a visual representation of the structure.

No, that's not true.

ISO/IEC 9899:1990

As discussed in, a structure is a type consisting of a
sequence of named members, whose storage is allocated in an ordered
sequence, and a union [stuff we don't care about].

Within a structure object, the non-bit-field members and the units
in which bit-fields reside have addresses that increase in the order
in which they declared. A pointer to a structure object, suitably
converted, points to its initial member (or if that member is a
bit-field, then to the unit in which it resides, and vice versa.
There may therefore be unnammed padding withing a structure object,
but not at its beginning, as necessary to achieve the appropriate

There may also be unnamed padding at the end of a structure or
union, as necessary to achieve the appropriate alignment were the
structure or union to be an element of an array.

You can look at other things too... you can memcpy structures, pass
them into functions, call sizeof, put them in arrays... it _is_ a
physical representation.

Alan Shutko <> - In a variety of flavors!
Conscience is what hurts when everything else feels so good.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.050 / U:1.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site