https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896
--- Comment #10 from Martin Uecker <muecker at gwdg dot de> --- And to get bounds checking for the flexible array member today, one could use a macro to attach the bound back to the array on member access. https://godbolt.org/z/GbaoYrhav But the bound from the type is not fed back into __builtin_dynamic_object_size(), so this currently only helps for direct array refs. But this is something we may be able to improve.