This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/54686] std::abs (long long) resorts to std::abs (double) if llabs is absent
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 23 Sep 2012 21:20:46 +0000
- Subject: [Bug target/54686] std::abs (long long) resorts to std::abs (double) if llabs is absent
- Auto-submitted: auto-generated
- References: <bug-54686-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54686
--- Comment #8 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-09-23 21:20:46 UTC ---
(In reply to comment #5)
> Er, abs is the exception there. signed integers have their own overloads of abs
> (in cstdlib). Seems like only unsigned integers get converted to double, which
> is rather funny :-) Not sure that was intentional in the standard...
Thanks god (or whoever) that the following:
unsigned int test_xx (unsigned int a)
{
return std::abs (a);
}
ends up as a nop. *phew*.
BTW, not so funny ;)