[PATCH] Fix bogus function cast warning for functions with common arg subset

Siddhesh Poyarekar siddhesh@sourceware.org
Fri Feb 23 18:52:00 GMT 2018


On Saturday 24 February 2018 12:01 AM, Richard Biener wrote:
> I don't see how the function cast is valid. 
> 
> I've argued for void (*) () to/from void (*) (int), etc. In the past and that was shot down similarly. This looks like exactly the same thing. 

That should not throw a warning because void (*) (void) is used as a
wildcard to match all functions.  My understanding from the discussions
around the patch implementation was that these are heuristics and are
not meant to catch all cases anyway.  In such a scenario it might be
prudent to avoid breaking behaviour that many programs seem to assume.

Siddhesh



More information about the Gcc-patches mailing list