Bug 216633 - x11/slim: fails to build with clang 4.0
Summary: x11/slim: 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: Jan Beich
URL:
Keywords: needs-patch
Depends on:
Blocks: 216008
  Show dependency treegraph
 
Reported: 2017-01-30 23:33 UTC by Jan Beich
Modified: 2017-01-31 02:49 UTC (History)
1 user (show)

See Also:


Attachments
patch to fix build (896 bytes, patch)
2017-01-31 01:50 UTC, Henry Hu
henry.hu.sh: maintainer-approval+
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-30 23:33:23 UTC
panel.cpp:51:13: error: ordered comparison between pointer and zero ('GC' (aka '_XGC *') and 'int')
                if (WinGC < 0) {
                    ~~~~~ ^ ~

build log: http://package18.nyi.freebsd.org/data/headamd64PR216008-default/2017-01-29_16h09m05s/logs/errors/slim-1.3.6_12.log
regressed by: https://github.com/llvm-mirror/clang/commit/4b6ad14285f3
Comment 1 Henry Hu 2017-01-31 01:50:57 UTC
Created attachment 179453 [details]
patch to fix build

I don't have clang 4.0 for now, so I can't test it, but this patch should work.
Honestly, I think that this check should be removed. From Xlib.h:
/*
 * Graphics context.  The contents of this structure are implementation
 * dependent.  A GC should be treated as opaque by application code.
 */
XCreateGC's man page does not mention what the return value would be if it failed, and after checking 10 pages of github search results, no one checked the return value of XCreateGC.
However, given that GC is a pointer, checking it against NULL should serve the purpose.
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-01-31 02:45:13 UTC
A commit references this bug:

Author: jbeich
Date: Tue Jan 31 02:44:48 UTC 2017
New revision: 432893
URL: https://svnweb.freebsd.org/changeset/ports/432893

Log:
  x11/slim: unbreak build with clang/libc++ 4.0

  PR:		216633
  Submitted by:	Henry Hu <henry.hu.sh@gmail.com> (maintainer)

Changes:
  head/x11/slim/Makefile
  head/x11/slim/files/patch-panel.cpp
Comment 3 Jan Beich freebsd_committer freebsd_triage 2017-01-31 02:48:22 UTC
Thanks. Landed. Builds fine with Clang 4.0 now.
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-01-31 02:49:18 UTC
A commit references this bug:

Author: jbeich
Date: Tue Jan 31 02:49:07 UTC 2017
New revision: 432894
URL: https://svnweb.freebsd.org/changeset/ports/432894

Log:
  MFH: r432893

  x11/slim: unbreak build with clang/libc++ 4.0

  PR:		216633
  Submitted by:	Henry Hu <henry.hu.sh@gmail.com> (maintainer)
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2017Q1/
  branches/2017Q1/x11/slim/Makefile
  branches/2017Q1/x11/slim/files/patch-panel.cpp