<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 29, 2015 at 2:29 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.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"><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, May 29, 2015 at 11:45 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Thu, May 28, 2015 at 6:55 PM, Keno Fischer <span dir="ltr"><<a href="mailto:kfischer@college.harvard.edu" target="_blank">kfischer@college.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't really have a strong opinion either way, I just wanted to bring it up as last time I touched this file a strong preference for moving everything to ErrorOr was expressed in the review, because it's easy to ignore the std::error_code.<br></blockquote></span><div><br>*nod* I'll +1 this idea, but I haven't looked at these APIs to see how ingrained the options are. I also don't think there's a /huge/ cognitive overload to some inconsistency here, so I'd be willing to pay some inconsistency to move towards ErrorOr over error_code+out parameter.<br></div></div></div></div></blockquote><div><br></div></span><div>Hm... I'm kind of worried about the boilerplate on the caller side: there are dozens of calls of these methods in LLVM tools.</div></div></div></div></blockquote><div><br>I rather like APIs that are a little safer-by-design, but yes - it can add some verbosity. I'm not sure if there's a nice solution there.<br><br>Internally, Google is still grappling with this problem (with similar abstractions to ErrorOr, error_code, etc), some people playing with macros to do it, etc. So it doesn't seem like there's a simple answer we're missing... (or at least if we've missed, so have a lot of other people, which is reassuring)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>What do you think of using __attribute__((warn_unused_result)) instead?</div></div></div></div></blockquote><div><br>ErrorOr should certainly have that attribute (as should std::error_code - problem is we can't put it on the standard library) - doing it on a per-function basis is a bit, similarly, error-prone and verbose.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div><span><br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10111&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=Ly9SVQh6pU_EqO-oTZ2zn_lazll6j0xOkRNNOjO8x7s&s=DF8Bq4M1aygZizIsf1ifhxcAt6pvCWA8smCSsXmjprw&e=" target="_blank">http://reviews.llvm.org/D10111</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=Ly9SVQh6pU_EqO-oTZ2zn_lazll6j0xOkRNNOjO8x7s&s=qy5-GE5czrJlkS9_uGi8MJwKS3vs25Kxoz3bn6Rxv0o&e=" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
<br></span>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>
</blockquote></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</font></span></div></div>
</blockquote></div><br></div></div>