#67264 closed defect (fixed)

gmic-gimp/gmic-qt @3.2.3: builds failing on older macOS releases: call to 'abs' is ambiguous

Reported by: mascguy (Christopher Nielsen) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: gmic-gimp gmic-qt

Description

Details (identical failure occurring for both gmic-gimp and gmic-qt):

work/gmic-3.2.3/gmic-qt/src/FilterSelector/FiltersModelReader.cpp:534:27: error: call to 'abs' is ambiguous
          previewFactor = std::abs(previewFactor);
                          ^~~~~~~~

1 error generated.
make[2]: *** [CMakeFiles/gmic_qt.dir/src/FilterSelector/FiltersModelReader.cpp.o] Error 1

Based on a quick review of src/FilterSelector/FiltersModelReader.cpp, upstream may simply be missing #include <cstdlib> (or wherever std::abs is defined). But didn't dig too deeply.

https://ports.macports.org/port/gmic-gimp/details/

https://ports.macports.org/port/gmic-qt/details/

Change History (6)

comment:1 Changed 19 months ago by Marius Schamschula <mschamschula@…>

In e50d09d06f13c2e03b381ab8058ef1e76fa4032c/macports-ports (master):

gmic: attempt to fix "call to 'abs' is ambiguous"

See: #67264

comment:2 Changed 19 months ago by jmroot (Joshua Root)

Ambiguous doesn't mean undefined, it means there are multiple versions of the function defined that take different types, and it's not sure which one you meant. Casting to the appropriate type may help.

comment:3 Changed 19 months ago by Schamschula (Marius Schamschula)

comment:4 Changed 19 months ago by jmroot (Joshua Root)

Oh yeah, I forgot what a mess this is in C++. Some of the abs() overloads are in cstdlib and others are in cmath.

comment:5 Changed 19 months ago by Schamschula (Marius Schamschula)

Indeed! In this case I guessed wrong - it was cmath.

comment:6 Changed 19 months ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.