/usr/include/pm.h defines macros min/max/abs, overriding builtins and screwing up C++ std::min/...

Bug #548677 reported by Markus Stürmer
10
This bug affects 2 people
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://de.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Skand Hurkat (skand-hurkat) wrote :

Confirmed the bug in Ubuntu Precise

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in netpbm-free (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.