[PATCH v2] xfs: Silence bounds checking compiler warning

Andi Kleen andi at firstfloor.org
Thu Jun 23 12:27:26 CDT 2011


Maarten Lankhorst <m.b.lankhorst at gmail.com> writes:

> gcc with -Warray-bounds generates a false positive on this
> since xfs defines the struct with u8 name[1]; to be able to
> add a tag at the end.

A better way would be to define it as name[0]. Then the compiler
would know it's a VLA. You may need to check noone relies on
the one byte though.

-Andi
-- 
ak at linux.intel.com -- Speaking for myself only




More information about the xfs mailing list