On Fri Jan 27 18:23:47 2023 +0000, Zebediah Figura wrote:
__WINE_MALLOC is not appropriate for functions that return
initialized objects. I was confused about this assertion, so I went and looked at the documentation, which includes the restriction "no pointers to valid objects occur in any storage addressed by [the return value]". I don't know why this is a restriction, but it also means that we can't put that attribute on realloc or anything like it, which we already have incorrectly done.
Thank you for pointing me to the GCC documentation. You're right: The documentation says that the returned memory cannot contain valid pointers, and it explicitly says that realloc cannot have `__attribute__((malloc))`. I'm sure I read that at one point but forgot about it :-( I will send patches to remove the annotations that I've added in error.