[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


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.

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

I committed
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