This patch does the same thing effectively. <br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 14, 2016 at 11:00 PM Noel Grandin <<a href="mailto:noelgrandin@gmail.com">noelgrandin@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">grandinj added a comment.<br class="gmail_msg">
<br class="gmail_msg">
You might like to take a look at the ConstCharArrayDetector stuff in the LibreOffice codebase here:<br class="gmail_msg">
<br class="gmail_msg">
  <a href="https://cgit.freedesktop.org/libreoffice/core/tree/include/rtl/ustring.hxx" rel="noreferrer" class="gmail_msg" target="_blank">https://cgit.freedesktop.org/libreoffice/core/tree/include/rtl/ustring.hxx</a><br class="gmail_msg">
<br class="gmail_msg">
where Stephan Bergman has implemented optimisations to avoid calling strlen() at runtime when dealing with static const char arrays.<br class="gmail_msg">
<br class="gmail_msg">
As far as I know, clang will compute strlen() at compile time if it knows the string being passed is a static constant<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D25639" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D25639</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>