Bug 216228 - graphics/py-poppler-qt4: fails to build with clang 4.0
Summary: graphics/py-poppler-qt4: fails to build with clang 4.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias C. Berner
URL:
Keywords: needs-patch
Depends on:
Blocks: 216008
  Show dependency treegraph
 
Reported: 2017-01-18 11:52 UTC by Jan Beich
Modified: 2017-01-31 00:04 UTC (History)
3 users (show)

See Also:
martin.dieringer: maintainer-feedback+


Attachments
proposed fix: PyList_SET_ITEM -> PyList_SetItem (1.61 KB, patch)
2017-01-21 07:25 UTC, Tobias C. Berner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2017-01-18 11:52:15 UTC
types.sip:30:56: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if (obj == NULL || PyList_SET_ITEM (l, i, obj) < 0)
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~

build log: http://sprunge.us/hgJC
regressed by: https://github.com/llvm-mirror/clang/commit/4b6ad14285f3
Comment 1 Jan Beich freebsd_committer freebsd_triage 2017-01-21 03:32:16 UTC
The fix here would probably be similar to bug 216253.
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2017-01-21 07:25:31 UTC
Created attachment 179176 [details]
proposed fix: PyList_SET_ITEM -> PyList_SetItem
Comment 3 Jan Beich freebsd_committer freebsd_triage 2017-01-21 20:46:31 UTC
Comment on attachment 179176 [details]
proposed fix: PyList_SET_ITEM -> PyList_SetItem

Looks OK and builds fine[1]. Can you land under "portmgr blanket" as a maintainer approval? Also add "MFH: 2017Q1" to commit message.

[1] 10.3 i386: http://sprunge.us/NETT
    /projects/clang400-import i386: http://sprunge.us/JjTD
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-01-21 22:11:35 UTC
A commit references this bug:

Author: tcberner
Date: Sat Jan 21 22:10:43 UTC 2017
New revision: 432089
URL: https://svnweb.freebsd.org/changeset/ports/432089

Log:
  Fix graphics/py-poppler-qt4: fails to build with clang 4.0

    PyList_SET_ITEM() is supposed to be void, but as a macro it's an
    expression and has a pointer value. Clang 4.0 trips on the bogus
    pointer comparison; given the comparison, it should be PyList_SetItem()
    which returns -1 on failure.

  PR:		216228
  Approved by:	portmgr blanket, rakuco (mentor)
  MFH:		2017Q1

Changes:
  head/graphics/py-poppler-qt4/Makefile
  head/graphics/py-poppler-qt4/files/
  head/graphics/py-poppler-qt4/files/patch-types.sip
Comment 5 martin.dieringer 2017-01-22 21:13:46 UTC
Still compiles with clang 3.9.1 so fix should be ok ...
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-01-23 20:41:10 UTC
A commit references this bug:

Author: tcberner
Date: Mon Jan 23 20:40:08 UTC 2017
New revision: 432289
URL: https://svnweb.freebsd.org/changeset/ports/432289

Log:
  MFH: r432089

  Fix graphics/py-poppler-qt4: fails to build with clang 4.0

    PyList_SET_ITEM() is supposed to be void, but as a macro it's an
    expression and has a pointer value. Clang 4.0 trips on the bogus
    pointer comparison; given the comparison, it should be PyList_SetItem()
    which returns -1 on failure.

  PR:		216228
  Approved by:	portmgr blanket, rakuco (mentor)

  Approved by:	ports-secteam (junovitch), rakuco (mentor)

Changes:
_U  branches/2017Q1/
  branches/2017Q1/graphics/py-poppler-qt4/Makefile
  branches/2017Q1/graphics/py-poppler-qt4/files/