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: ibuc...@gdcproject.org Reporter: art.08...@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.