This is the mail archive of the gcc-patches@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: [New testcase] Wrong: "warning: `noreturn' function does return"


Hi
About the noreturn warnings.  What always wondered me is why we don't
use CFG to detect this infomration?  I have an code at home to autodetect
noreturn attribute in similar way as we do for const, and it seems to work
reliably.  Is there some purpose for doing this in frontend?

One difference I've noticed is that we get warnings now even for "main"
with -Wnoreturn.

I will probably send the patch soon, I was basically waiting for "pure"
attribute autodetection to get reviewed to avoid multiple patches in the
queue.

Another plus is that -Wnoreturn the empty function
void test()
{
}
don't get bogus warning.

Honza

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