<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 22, 2016 at 8:27 AM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif"><span class="">
<p><span style="color:rgb(33,33,33);font-size:12pt">></span><span style="color:rgb(33,33,33);font-size:12pt">This should probably be written with an assert instead:</span><br>
</p>
</span><div style="color:rgb(33,33,33)">
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span class="">
<div>></div>
<div>> assert((!this->Sec || this->Sec == Sec) && "multiple .eh_frame sections ....");</div>
<div> <br>
</div></span>
This should never happen, and if will due to a bug or something then result is completely unknown, because<br>
</div>
<div class="gmail_quote">code does not suppose that. So it is fatal error actually.</div></div></div></div></div></div></blockquote><div><br></div><div>If it's never meant to happen (if it does happen, it's a programmer error) then that's entirely appropriate for an assertion.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif"><div style="color:rgb(33,33,33)"><div><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote">That why I think unreachable fits better than assert and also t<span style="font-size:12pt">here is no asserts in release usually.</span></div></div></div></div></div></div></blockquote><div><br></div><div>That's correct - assertions are used to test for programmatic errors/mistakes.<br><br>unreachable is roughly equivalent - if not worse, with unreachable, in an -O0 build the unreachable behaves something like an assert (the program will fail hard, print an error, etc) but in anything else, LLVM will optimize assuming the condition is true. This means if the condition is not true, the behavior may be worse than just continuing without having done anything. LLVM will deduce that the condition /must/ be true.<br><br>- Dave</div><div> </div></div><br></div></div>