[Bug c/77392] Premature optimization based on return data from thread

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Aug 28 05:53:00 GMT 2016


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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
More to the point if do the following casts GCC would have errored out:
(void*)send_message
(void*)&thread_retval

Since you have the cast and in C, void* has an implicit cast to any other
pointer type, GCC does not error out.

I suspect you added those cast to allow the code to be accepted in the first
place and that is wrong.


More information about the Gcc-bugs mailing list