Tags 998498 +patch Thanks
This looks like a problem with libnetpbm10-dev, it should not #define generic max/min macros in a public header.
This can be worked around by changing the order in which headers are included, so the C++ standard library headers are included before the netpbm headers and hence unaffected by the macro. Debdiff is attatched and has been uploaded to raspbian, no intent to NMU in Debian.
diff -Nru pfstools-2.2.0/debian/changelog pfstools-2.2.0/debian/changelog --- pfstools-2.2.0/debian/changelog 2021-08-29 16:19:07.000000000 +0000 +++ pfstools-2.2.0/debian/changelog 2021-12-09 19:43:19.000000000 +0000 @@ -1,3 +1,10 @@ +pfstools (2.2.0-1+rpi1) bookworm-staging; urgency=medium + + * Reorder includes to stop macro in pm.h causing breakage in + c++ system headers (Closes: 998498) + + -- Peter Michael Green <plugw...@raspbian.org> Thu, 09 Dec 2021 19:43:19 +0000 + pfstools (2.2.0-1) unstable; urgency=medium * New upstream version. diff -Nru pfstools-2.2.0/debian/patches/43_reorder-includes-netpbm.patch pfstools-2.2.0/debian/patches/43_reorder-includes-netpbm.patch --- pfstools-2.2.0/debian/patches/43_reorder-includes-netpbm.patch 1970-01-01 00:00:00.000000000 +0000 +++ pfstools-2.2.0/debian/patches/43_reorder-includes-netpbm.patch 2021-12-09 19:43:19.000000000 +0000 @@ -0,0 +1,23 @@ +Description: Reorder includes to stop macro in pm.h causing breakage in c++ system headers +Author: Peter Michael Green <plugw...@raspbian.org> +Bug-Debian: https://bugs.debian.org/998498 + +--- pfstools-2.2.0.orig/src/fileformat/ppmio.cpp ++++ pfstools-2.2.0/src/fileformat/ppmio.cpp +@@ -27,13 +27,13 @@ + + #include "ppmio.h" + ++#include <math.h> ++#include <assert.h> ++ + extern "C" { + #include <ppm.h> + } + +-#include <math.h> +-#include <assert.h> +- + struct PPMData + { + pixval maxPV; diff -Nru pfstools-2.2.0/debian/patches/series pfstools-2.2.0/debian/patches/series --- pfstools-2.2.0/debian/patches/series 2021-08-29 16:11:20.000000000 +0000 +++ pfstools-2.2.0/debian/patches/series 2021-12-09 19:43:19.000000000 +0000 @@ -4,3 +4,4 @@ 25_Multiple-typo-fixes-suggested-by-lintian.patch 30_parallel_build.diff 42_reorder-includes-imagemagick.patch +43_reorder-includes-netpbm.patch