This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] selftest.h: mark failure functions with "noreturn"
On 8/26/16, Bernd Schmidt <bschmidt@redhat.com> wrote:
> On 08/26/2016 06:05 PM, David Malcolm wrote:
>> selftest::fail and selftest::fail_formatted call abort. Marking
>> them as "noreturn" can help eliminate false warnings about unreachable
>> code in selftests.
>>
>> Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
>>
>> OK for trunk?
>
> Don't we want to wrap this in some ATTRIBUTE_NORETURN macro for
> portability?
>
One already exist in include/ansidecl.h; lots of files already use the macro:
$ git grep ATTRIBUTE_NORETURN | wc -l
96
So yeah, I'd say it should be used here, too.
Eric