D.gnu - [Bug 206] New: Wrong gcc5 __builtin_OPNAME_overflow signatures.
- via D.gnu (40/42) Jan 08 2016 Date: Sat, 9 Jan 2016 05:51:10 +0000
Date: Sat, 9 Jan 2016 05:51:10 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" http://bugzilla.gdcproject.org/show_bug.cgi?id=206 Bug ID: 206 Summary: Wrong gcc5 __builtin_OPNAME_overflow signatures. Product: GDC Version: development Hardware: All OS: All Status: NEW Severity: normal Priority: Normal Component: gdc Assignee: ibuclaw gdcproject.org Reporter: art.08.09 gmail.com For example:import gcc.builtins; pragma(msg, typeof(__builtin_add_overflow));-> pure nothrow nogc safe extern (C) bool() Which makes them unusable from D. --------------------------------------------- void bug() { int r; __builtin_add_overflow(1, 2, &r); } --------------------------------------------- -> error: function gcc.builtins.__builtin_add_overflow () is not callable using argument types (int, int, int*) They do work if the type is overridden; ie this hack works: trusted bool overflow(string OP, A, B, R)(A a, B b, R* r) { import gcc.builtins; auto baofp = cast(typeof(&overflow))&mixin("__builtin_"~OP~"_overflow"); return (*baofp)(a, b, r); } if (overflow!"add"(a, b, &r)) error(); -- You are receiving this mail because: You are watching all bug changes.
Jan 08 2016