This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ATTRIBUTE_NORETURN on sets_cc0_p


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]