Bug 216636 - sysutils/samesame: fails to build with clang 4.0
Summary: sysutils/samesame: 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:49 UTC by Jan Beich
Modified: 2017-03-20 00:01 UTC (History)
2 users (show)

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


Attachments
The patch use a explicit cast (void *) and a more specific value -1 (625 bytes, patch)
2017-02-05 22:50 UTC, akruijff
no flags Details | Diff
Attached new patch file (613 bytes, patch)
2017-03-19 22:24 UTC, akruijff
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 2017-01-30 23:49:53 UTC
src/mainAction.cpp:184:19: error: ordered comparison between pointer and zero ('FILE *' (aka '__sFILE *') and 'int')
                                if (pipeLeafs < 0)
                                    ~~~~~~~~~ ^ ~
src/mainAction.cpp:197:21: error: ordered comparison between pointer and zero ('FILE *' (aka '__sFILE *') and 'int')
                                if (outputLeafs < 0)
                                    ~~~~~~~~~~~ ^ ~

build log: http://package18.nyi.freebsd.org/data/headamd64PR216008-default/2017-01-29_16h09m05s/logs/errors/samesame-1.10.log
regressed by: https://github.com/llvm-mirror/clang/commit/4b6ad14285f3
Comment 1 akruijff 2017-02-05 22:50:35 UTC
Created attachment 179660 [details]
The patch use a explicit cast (void *) and a more specific value -1
Comment 2 Jan Beich freebsd_committer 2017-02-05 23:45:18 UTC
Comment on attachment 179660 [details]
The patch use a explicit cast (void *) and a more specific value -1

> -				if (pipeLeafs < 0)
> +				if (pipeLeafs == (void *)-1)

popen(3) unlike pipe(2) returns NULL on failure, not (void *)-1.

> -				if (outputLeafs < 0)
> +				if (outputLeafs == (void *)-1)

Ditto for fopen(3) unlike open(2).
Comment 3 akruijff 2017-03-19 22:24:36 UTC
Created attachment 180974 [details]
Attached new patch file
Comment 4 commit-hook freebsd_committer 2017-03-20 00:01:04 UTC
A commit references this bug:

Author: jbeich
Date: Mon Mar 20 00:00:02 UTC 2017
New revision: 436516
URL: https://svnweb.freebsd.org/changeset/ports/436516

Log:
  sysutils/samesame: unbreak with clang 4.0

  src/mainAction.cpp:184:19: error: ordered comparison between pointer and zero ('FILE *' (aka '__sFILE *') and 'int')
                                  if (pipeLeafs < 0)
                                      ~~~~~~~~~ ^ ~
  src/mainAction.cpp:197:21: error: ordered comparison between pointer and zero ('FILE *' (aka '__sFILE *') and 'int')
                                  if (outputLeafs < 0)
                                      ~~~~~~~~~~~ ^ ~

  PR:		216636
  Submitted by:	akruijff@dds.nl
  Approved by:	portmgr blanket

Changes:
  head/sysutils/samesame/Makefile
  head/sysutils/samesame/files/patch-src_mainAction.cpp