This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] [PATCH] Add a warning for invalid function casts
On Thu, 5 Oct 2017, Bernd Edlinger wrote:
> Maybe it would be good to not warn in type-casts, when they can be
> assumed to be safe, for instance
> void* <-> any pointer (parameter or result),
> uintptr_t <-> any int, any pointer (parameter or result),
> void (*) (void) and void (*) (...) <-> any function pointer.
Well, void * and uintptr_t aren't necessarily interchangable at the ABI
level. At least, the m68k ABI returns integers in %d0 and pointers in
%a0; I don't know if any other ABIs have that peculiarity.
--
Joseph S. Myers
joseph@codesourcery.com