<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 30/10/2014 18:57, Rodrigo Kumpera
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACmR+BBfyc7MP1TZBO=K2JFJyh1MK7BzvTpP583kN=QKOnmxkw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Forgot to CC dev
        <div><br>
          <div class="gmail_quote">---------- Forwarded message
            ----------<br>
            From: <b class="gmail_sendername">Rodrigo Kumpera</b> <span
              dir="ltr"><<a moz-do-not-send="true"
                href="mailto:kumpera@gmail.com">kumpera@gmail.com</a>></span><br>
            Date: Thu, Oct 30, 2014 at 1:57 PM<br>
            Subject: Re: [Mono-dev] [eglib] Warning: assertion function
            returning<br>
            To: Alex J Lennon <<a moz-do-not-send="true"
              href="mailto:ajlennon@dynamicdevices.co.uk">ajlennon@dynamicdevices.co.uk</a>><br>
            <br>
            <br>
            <div dir="ltr"><br>
              <div class="gmail_extra"><br>
                <div class="gmail_quote"><span class="">On Thu, Oct 30,
                    2014 at 12:34 PM, Alex J Lennon <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:ajlennon@dynamicdevices.co.uk"
                        target="_blank">ajlennon@dynamicdevices.co.uk</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div text="#000000" bgcolor="#FFFFFF"> Hi Rodrigo,<span><br>
                          <br>
                          <div>On 30/10/2014 17:28, Rodrigo Kumpera
                            wrote:<br>
                          </div>
                          <blockquote type="cite">
                            <div dir="ltr">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.</div>
                            <div class="gmail_extra"><br>
                            </div>
                          </blockquote>
                          <br>
                        </span> If that's what's wanted that's fine by
                        me of course. Easily done.<br>
                        <br>
                        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?<br>
                        <br>
                        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.<br>
                        <br>
                        I am guessing I am misunderstanding your point?<br>
                        <br>
                        More importantly, should the assertion handler
                        return or not... ?<br>
                      </div>
                    </blockquote>
                    <div><br>
                    </div>
                  </span>
                  <div>The problem is that the abort happens through the
                    logging callback and that can't be verified by the
                    compiler.</div>
                  <div><br>
                  </div>
                  <div>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.</div>
                  <div>We want the noreturn semantics there.</div>
                  <div><br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    OK thanks. I agree I tend to think an assertion handler shouldn't
    continue execution (if things have blown up to that extent then it's
    perhaps better not to try to soldier on...)<br>
    <br>
    I am sort of wondering what that means in real world production
    systems though. e.g. Something unexpected happens, Mono outputs an
    assertion and hangs with the CPU full on?<br>
    <br>
    That would be less than ideal for the type of use cases I have, with
    an black box embedded system possibly running on batteries.<br>
    <br>
    Most simplistic system watchdog / error condition handling probably
    just checks for the existence of the process, restarting the process
    or the hardware on error, so Mono getting locked into a while(1);
    look wouldn't be caught I imagine?<br>
    <br>
    Wouldn't it be better for the process to log an error and exit in
    some manner when the assertion handler is called?<br>
    <br>
    (Just some thoughts...)<br>
    <br>
    Cheers, Alex<br>
    <br>
  </body>
</html>