This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ATTRIBUTE_NORETURN on sets_cc0_p
- To: law at cygnus dot com
- Subject: Re: ATTRIBUTE_NORETURN on sets_cc0_p
- From: Mark Mitchell <mark at markmitchell dot com>
- Date: Fri, 16 Oct 1998 08:07:27 -0700
- CC: ghazi at caip dot rutgers dot edu, egcs at cygnus dot com
- References: <14763.908525405@hurl.cygnus.com>
- Reply-to: mark at markmitchell dot com
>>>>> "Jeffrey" == Jeffrey A Law <law@cygnus.com> writes:
Jeffrey> I'm very tempted to punt it for now since marking
Jeffrey> sets_cc0_p as noreturn is strictly an optimization.
And a pretty unimportant one. It's only noreturn because all it does
is call `abort()' in the non-HAVE-cc0 case. We could just call abort
directly in that case via some macro magic if it's that important to
let the compiler know the call will not return.
I don't really think the `function not marked noreturn but doesn't
return' warning is very good. This warnings means that to get gcc to
shut up, I *must* use a gcc extension on perfectly valid, unambiguous,
unconfusing code. That's unreasonable. This warning attempts to
force me to give the compiler an additional optimization hint, not to
in any way clarify the function. (It's not like signed/unsigned
comparison, for example, which is well-defined but wicked confusing.)
I think the right solution is no pull this warning out of -W -Wall,
and only enable it with a special -Wnoreturn flag or some such.
I don't have a problem with the opposite warning (`function uses
noreturn but returns anyhow').
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com