/usr/include/pm.h defines macros min/max/abs, overriding builtins and screwing up C++ std::min/...
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netpbm-free (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: libnetpbm10-dev
/usr/include/pm.h, included by basically all netpbm headers (development), defines macros min, max and abs.
While overriding builtins and the implementations in math.h / cmath / algorithm, it screws up any usage of std::min / std::max.
BTW, it is an really old version of netpbm...
Example C++ program, compiling only after uncommenting the undef line:
/******
#include <algorithm>
#include <pam.h>
// #undef min
int mymin( int a , int b ) {
return std::min( a , b );
}
/******
$ apt-cache policy libnetpbm10-dev
libnetpbm10-dev:
Installed: 2:10.0-12ubuntu1
Candidate: 2:10.0-12ubuntu1
Version table:
*** 2:10.0-12ubuntu1 0
500 http://
100 /var/lib/
Confirmed the bug in Ubuntu Precise