Bug 209675 - graphics/inkscape: Fix build with libc++ 3.8.0
Summary: graphics/inkscape: Fix build with libc++ 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks: 208158
  Show dependency treegraph
 
Reported: 2016-05-20 22:22 UTC by Dimitry Andric
Modified: 2016-06-07 04:22 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gnome)


Attachments
Fix type for abs() calls in graphics/inkscape (4.25 KB, patch)
2016-05-20 22:22 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2016-05-20 22:22:34 UTC
Created attachment 170521 [details]
Fix type for abs() calls in graphics/inkscape

During the exp-run in bug 208158, it was found that graphics/inkscape gives errors with libc++ 3.8.0 [1]:

libavoid/connector.cpp:888:29: error: call to 'abs' is ambiguous
                COLA_ASSERT(abs(i->pathNext->id.objID - i->id.objID) != 2);
                            ^~~

This is because abs() is called with unsigned arguments.  Fix it by casting the arguments to the appropriate signed types.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-05-01_10h29m48s/logs/errors/inkscape-0.91_6.log
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-06-07 04:15:11 UTC
A commit references this bug:

Author: truckman
Date: Tue Jun  7 04:14:38 UTC 2016
New revision: 416493
URL: https://svnweb.freebsd.org/changeset/ports/416493

Log:
  Fix type for abs() calls in graphics/inkscape

  During the exp-run in bug 208158, it was found that graphics/inkscape
  gives errors with libc++ 3.8.0:

  libavoid/connector.cpp:888:29: error: call to 'abs' is ambiguous
                  COLA_ASSERT(abs(i->pathNext->id.objID - i->id.objID) != 2);
                              ^~~

  This is because abs() is called with unsigned arguments.  Fix it
  by casting the arguments to the appropriate signed types.  This
  mimics what happens with older libraries where the only version of
  abs() was the one in <stdlib.h>, which is prototyped:
  	int abs(int)
  The expression used in ConnRef::generatePath() is not strictly correct
  because it depends on details of integer overflow that are undefined
  by the C++ standard.

  PR:		209675
  Submitted by:	dim

Changes:
  head/graphics/inkscape/files/
  head/graphics/inkscape/files/patch-src_libavoid_connector.cpp
  head/graphics/inkscape/files/patch-src_ui_tools_flood-tool.cpp