https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123858

--- Comment #4 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Jiang XueZhi from comment #2)
> I have a follow-up question: If a return type is cast from another type to
> void, does this imply there is no ABI compatibility risk, and thus should
> not trigger the -Wcast-function-type warning?

No, consider functions that return structures that are too large to fit in
registers. They are handled by having the caller allocate memory for the return
value and passing the pointer as a hidden argument. Taking away the information
on the caller side that such a structure is returned means that the caller
cannot ensure that memory is allocated for it.

Reply via email to