[Bug c/67629] bogus -Wreturn-type in a function with tautological if-else
mwoehlke.floss at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Sep 24 14:47:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67629
--- Comment #8 from Matthew Woehlke <mwoehlke.floss at gmail dot com> ---
Given what -Wreturn-type is trying to accomplish, I wonder if a "delayed
issuance" strategy would be in order? IOW, have the front end "trigger" the
warning, as now, but stuff it in a queue or such, continue on with
optimization, then go back and check the queue to see if the warning still
looks legitimate, and only *then* emit it.
Where this gets sticky is that at -O0, we still may not know that the warning
is spurious. We might, ideally, want to perform optimization anyway on a
function with a "pending" -Wreturn-type warning, but throw out the result.
More information about the Gcc-bugs
mailing list