https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86483
--- Comment #4 from gnzlbg <gonzalobg88 at gmail dot com> --- @Jonathan Wakely: > If you tell the compiler the storage is smaller than 'usize' you're asking it > to treat accesses past 'size' bytes as undefined behaviour (even though > actually accesses up to usize are valid). Indeed. Expressing that the pointer in smallocx_return_t::ptr points to an allocation of smallocx_return_t::size is probably too hard to be useful, since how this size is computed can be arbitrarily complex. The same applies to somehow expressing the minimum alignment from the amount requested but encoded in "int flags". The only the attribute that I think I should be able to use here is the "malloc" attribute for the struct pointer.