<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:naruse@airemix.jp" title="NARUSE, Yui <naruse@airemix.jp>"> <span class="fn">NARUSE, Yui</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - No support for gcc "error" function attribute"
   href="https://bugs.llvm.org/show_bug.cgi?id=38091">bug 38091</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - No support for gcc "error" function attribute"
   href="https://bugs.llvm.org/show_bug.cgi?id=38091#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - No support for gcc "error" function attribute"
   href="https://bugs.llvm.org/show_bug.cgi?id=38091">bug 38091</a>
              from <span class="vcard"><a class="email" href="mailto:naruse@airemix.jp" title="NARUSE, Yui <naruse@airemix.jp>"> <span class="fn">NARUSE, Yui</span></a>
</span></b>
        <pre>(In reply to Richard Smith from <a href="show_bug.cgi?id=38091#c1">comment #1</a>)
<span class="quote">> It looks to me like it's just the *implementation* of the rb_scan_args check
> that depends on the optimizer in order to implement the check (that is, it
> generates the "bad" call unconditionally, but within a sea of conditional
> expressions that make the call unreachable in the good cases), and that the
> diagnose_if attribute is actually better suited to this kind of enforcement
> than the GCC error attribute is. Indeed, the __attribute__((error))
> enforcement will not work at -O0, and is compiled out in that case (by
> checking the __OPTIMIZE__ macro), but a diagnose_if approach would work at
> -O0.

> Please correct me if I've misunderstood any of the details here. But I'm
> inclined to say that Clang provides a superior alternative here.</span >

Indeed.
I sometimes tried to use diagnose_if but failed because of <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - function attribute "diagnose_if" doesn't see const char *"
   href="show_bug.cgi?id=38095">Bug 38095</a> and Bug
38111.
Now I have a workaround and understand that the idea of <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - No support for gcc "error" function attribute"
   href="show_bug.cgi?id=38091">Bug 38091</a> is come from
misunderstanding.

I committed
<a href="https://github.com/ruby/ruby/commit/4b2f2225e4a94cd2eeb8f9c8f867192f50dd6b32">https://github.com/ruby/ruby/commit/4b2f2225e4a94cd2eeb8f9c8f867192f50dd6b32</a>,
and mark this ticket as RESOLVED, thanks!</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>