windows.globalization: Use a flexible array member for hstring_vector.

GCC 11 complains about accessing struct hstring_vector (-Warray-bounds)
when the allocation is made for a 0-sized vector. Using a C99 flexible
array member gets rid of the warnings.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-24 09:54:23 +01:00 committed by Alexandre Julliard
parent 2b3bb9e868
commit e47fe70084
1 changed files with 3 additions and 1 deletions

View File

@ -54,9 +54,11 @@ struct hstring_vector
LONG ref;
ULONG count;
HSTRING values[1];
HSTRING values[];
};
C_ASSERT(sizeof(struct hstring_vector) == offsetof(struct hstring_vector, values[0]));
static inline struct hstring_vector *impl_from_IVectorView_HSTRING(IVectorView_HSTRING *iface)
{
return CONTAINING_RECORD(iface, struct hstring_vector, IVectorView_HSTRING_iface);