Warning report for wine-1.3.30-55-g583e887
octavian.voicu at gmail.com
Wed Oct 12 15:31:12 CDT 2011
On Wed, Oct 12, 2011 at 11:22 PM, Josh Juran <josh at iswifter.net> wrote:
> My understanding is that accessing element n or greater in an array[n]
> is undefined behavior, but declaring a huge array and allocating only
> part of it is valid.
It's a commonly used pattern in C. You declare a size-one array at the
end of a structure, then you allocate enough memory to hold the
structure plus (n-1) extra elements of the array. In wine size is
usually calculated with the macro FIELD_OFFSET(struct, member[size]).
More information about the wine-devel