Bug 35914 - missing int std::abs(int)
Summary: missing int std::abs(int)
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-12 10:45 UTC by Lukas Jirkovsky
Modified: 2008-04-12 19:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jirkovsky 2008-04-12 10:45:37 UTC
It seems that there is missing int std::abs(int) in gcc 4.3.0. System is Archlinux current.

Example output(from enblend cvs):
../../include/vigra/imageiteratoradapter.hxx:532: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cmath:99: note: candidates are: double std::abs(double)
/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cmath:103: note:                 float std::abs(float)
/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cmath:107: note:                 long double std::abs(long double)

GCC version:
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix --mandir=/usr/share/man --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.3.0 (GCC)
Comment 1 Paolo Carlini 2008-04-12 19:29:59 UTC
You want to include <cstdlib>: <cmath> only provides overloads for floating point types (see 26.5 for details).