bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing '_Noreturn'


From: Florian Weimer
Subject: Re: Missing '_Noreturn'
Date: Mon, 27 Jul 2020 09:03:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

* Paul Eggert:

> On 7/26/20 3:10 PM, Gisle Vanem wrote:
>> Here's an error though:
>>
>>    test-dfa-match-aux.c
>>    test-dfa-match-aux.c(39): error C2381: 'dfawarn': redefinition;
>>    '__declspec(noreturn)' or '[[noreturn]]' differs
>>    lib\dfa.h(125): note: see declaration of 'dfawarn'
>
> That's a bug in MSVC. _Noreturn and 'inline' are not part of a
> function's type, so the definition of a function can say '_Noreturn'
> even though its declaration does not. (Admittedly it's bad style.)

The compiler is correct for [[noreturn]]:

| The first declaration of a function shall specify the noreturn
| attribute if any declaration of that function specifies the noreturn
| attribute.

<http://eel.is/c++draft/dcl.attr.noreturn#:attribute,noreturn>

I agree that the test needs fixing.

Thanks,
Florian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]