Re: [PATCH 2/3] Add a lot of dummy returns to avoid warnings with NO_NORETURN

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 2/3] Add a lot of dummy returns to avoid warnings with NO_NORETURN

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:30

Andi Kleen [off-list ref] writes:
From: Andi Kleen <redacted>

Add a lot of dummy returns to silence "control flow reaches
end of non void function" warnings with disabled noreturn.

If NO_NORETURN is not disabled they will be all optimized away.
I think this is probably a bad move, given that the previous patch is a
temporary workaround until gcc 4.6 is fixed. With -Wunreachable-code on,
these will introduce noise for build without NO_NORETURN (either when
profile feedback is not used, or when profile feedback build is in use and
it no longer requires the NO_NORETURN workaround).

Re: [PATCH 2/3] Add a lot of dummy returns to avoid warnings with NO_NORETURN

From: Andi Kleen <hidden>
Date: 2016-06-15 22:51:30

On Mon, Jun 20, 2011 at 02:17:32PM -0700, Junio C Hamano wrote:
Andi Kleen [off-list ref] writes:
quoted
From: Andi Kleen <redacted>

Add a lot of dummy returns to silence "control flow reaches
end of non void function" warnings with disabled noreturn.

If NO_NORETURN is not disabled they will be all optimized away.
I think this is probably a bad move, given that the previous patch is a
This is basically the patch you suggested. Do you have some other suggestion 
now?

FWIW I preferred my original minimal patch and I can go back to that one.
temporary workaround until gcc 4.6 is fixed. With -Wunreachable-code on,
gcc mainline (and possibly 4.6.2) has it already fixed, but it's reasonable 
to assume 4.6.0 will be in use for a long time. There's nothing
"temporary" about compiler workarounds, unless you wait 10 years
or so.
these will introduce noise for build without NO_NORETURN (either when
profile feedback is not used, or when profile feedback build is in use and
it no longer requires the NO_NORETURN workaround).
I fixed the noise in a followon patch. 

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help