<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 3, 2015 at 1:17 PM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Feb 3, 2015, at 12:32 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 3, 2015 at 12:19 PM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi David,<div><br><div><span><blockquote type="cite"><div>On Feb 3, 2015, at 11:15 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Tue, Feb 3, 2015 at 11:03 AM, Owen Anderson<span> </span><span dir="ltr"><<a href="mailto:resistor@mac.com" target="_blank">resistor@mac.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi chandlerc, joker.eph,<br><br>This is useful when checking diagnostics and annotations that are only enabled in asserts mode. </blockquote><div><br></div><div>Not sure I quite follow - "REQUIRES: Asserts" would be used for any test case that's verifying a failure that's only enabled in asserts mode. "REQUIRES: no-asserts" would be for testing the absence of that same failure in a no-asserts build?<br><br>That seems like a thing I wouldn't want to test for. The idea is that the program has undefined behavior if it would assert but you're in a non-asserts build. That's not a thing to test for - there's no specific/guaranteed behavior in that case.</div></div></div></blockquote><div><br></div></span><div>To provide you with more context: I am expecting some optional metadata from the front-end, but in case they are malformed for any reason I want to be bullet proof and handle this case gracefully (i.e. undefined behavior / crashing is not acceptable). So I’d like my assert build to verify the validity of the metadata but my release build to ignore it and set a suitable default value that I know allows recovery most of the time.</div><div><br></div><div>I can’t add a test to check if we recover correctly from an invalid metadata without this.</div><div><br></div><div>This is valid in general for the category of assertions we put to enforce some invariant/properties that are important for optimization purposes but does not prevent us from generating a correct code if they are broken.</div><div><br></div><div>Does it make sense?</div></div></div></div></blockquote><div><br>Not sure how everyone else feels, but I'd rather classify something like that that has well-defined recovery semantics, as something other than 'validity’. <br></div></div></div></div></div></blockquote><div><br></div></span><div>To be sure I understand correctly: do you mean an assertions is not welcome on the normal path if we have a well-defined recovery path?</div></div></div></blockquote><div><br></div><div>So far, that's been our policy.</div><div><br>Owen, can you use the new backend diagnostic machinery that Quentin added? Is that flexible enough to allow suppressing the error in released builds and getting the correct developer behavior of emitting an error? Or do you really want to crash with a stack trace during development?</div></div></div></div>