[llvm-bugs] [Bug 38091] No support for gcc "error" function attribute

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 10 09:15:03 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38091

NARUSE, Yui <naruse at airemix.jp> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from NARUSE, Yui <naruse at airemix.jp> ---
(In reply to Richard Smith from comment #1)
> 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.

Indeed.
I sometimes tried to use diagnose_if but failed because of Bug 38095 and Bug
38111.
Now I have a workaround and understand that the idea of Bug 38091 is come from
misunderstanding.

I committed
https://github.com/ruby/ruby/commit/4b2f2225e4a94cd2eeb8f9c8f867192f50dd6b32,
and mark this ticket as RESOLVED, thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180710/00dfc25a/attachment-0001.html>


More information about the llvm-bugs mailing list