[Mono-dev] Fwd: [eglib] Warning: assertion function returning
Rodrigo Kumpera
kumpera at gmail.com
Thu Oct 30 17:57:58 UTC 2014
Forgot to CC dev
---------- Forwarded message ----------
From: Rodrigo Kumpera <kumpera at gmail.com>
Date: Thu, Oct 30, 2014 at 1:57 PM
Subject: Re: [Mono-dev] [eglib] Warning: assertion function returning
To: Alex J Lennon <ajlennon at dynamicdevices.co.uk>
On Thu, Oct 30, 2014 at 12:34 PM, Alex J Lennon <
ajlennon at dynamicdevices.co.uk> wrote:
> Hi Rodrigo,
>
> On 30/10/2014 17:28, Rodrigo Kumpera wrote:
>
> Since the noreturn behavior is not verifiable by the compiler (it's part
> of the API contract) we can a hack to silence the warning.
>
>
> If that's what's wanted that's fine by me of course. Easily done.
>
> But I don't understand: Surely the fact the compiler is complaining shows
> that it does know that the function is returning, when it has been told via
> the attributing that the function should not?
>
> As a test, if I add a while(1); at the bottom of the function then the
> complaint goes away as the compiler knows that the return is unreachable.
>
> I am guessing I am misunderstanding your point?
>
> More importantly, should the assertion handler return or not... ?
>
The problem is that the abort happens through the logging callback and that
can't be verified by the compiler.
Any well behaved implementation must make sure it does not return. I think
adding a while (1); at the end is a good enough solution.
We want the noreturn semantics there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20141030/13684143/attachment.html>
More information about the Mono-devel-list
mailing list