Bug 215861 - lang/spidermonkey170 & lang/spidermonkey24: fail to build with clang 4.0
Summary: lang/spidermonkey170 & lang/spidermonkey24: fail 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:
Depends on:
Blocks: 216008
  Show dependency treegraph
 
Reported: 2017-01-07 19:57 UTC by Jan Beich
Modified: 2017-01-31 00:04 UTC (History)
1 user (show)

See Also:


Attachments
Fix quote() failures (1.65 KB, patch)
2017-01-07 21:04 UTC, Jan Beich
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-07 19:57:35 UTC
jsopcode.cpp:6070:45: error: ordered comparison between pointer and zero ('char *' and 'int')
    return QuoteString(&sprinter, s, quote) >= 0;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~

full build log: http://sprunge.us/hcKI
Comment 1 Jan Beich freebsd_committer 2017-01-07 19:57:55 UTC
Upstream fix uses nullptr but the port predates -std=c++11, so we need to use NULL except it doesn't work. NULL is expanded to __null which is not a pointer. Why?

jsopcode.cpp:6070:45: error: ordered comparison between pointer and zero ('char *' and 'long')
    return QuoteString(&sprinter, s, quote) >= NULL;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
Comment 2 Jan Beich freebsd_committer 2017-01-07 21:04:44 UTC
Created attachment 178609 [details]
Fix quote() failures

$ cat >a.cc
int main(void)
{
  void *p = (void *)0xdeadbeef;
  return !(p >= 0);
}

$ c++ a.cc
a.cc:4:14: error: ordered comparison between pointer and zero ('void *' and 'int')
  return !(p >= 0);
           ~ ^  ~
1 error generated.
Comment 3 commit-hook freebsd_committer 2017-01-13 01:43:45 UTC
A commit references this bug:

Author: jbeich
Date: Fri Jan 13 01:42:46 UTC 2017
New revision: 431335
URL: https://svnweb.freebsd.org/changeset/ports/431335

Log:
  lang/spidermonkey170: unbreak with clang 4.0

  Fix quoting failure handling in JSOP_CALLPROP and JSOP_STRING.

  jsopcode.cpp:6070:45: error: ordered comparison between pointer and zero ('char *' and 'int')
      return QuoteString(&sprinter, s, quote) >= 0;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~

  PR:		215861
  Regressed by:	https://github.com/llvm-mirror/clang/commit/4b6ad14285f3
  Obtained from:	upstream (only the specific fix)
  Approved by:	portmgr blanket
  MFH:		2017Q1 (changes existing behavior)

Changes:
  head/lang/spidermonkey170/Makefile
  head/lang/spidermonkey170/files/patch-bug1012971
  head/lang/spidermonkey24/Makefile
  head/lang/spidermonkey24/files/patch-bug1012971
Comment 4 commit-hook freebsd_committer 2017-01-19 05:12:25 UTC
A commit references this bug:

Author: jbeich
Date: Thu Jan 19 05:12:03 UTC 2017
New revision: 431842
URL: https://svnweb.freebsd.org/changeset/ports/431842

Log:
  MFH: r431335

  lang/spidermonkey170: unbreak with clang 4.0

  Fix quoting failure handling in JSOP_CALLPROP and JSOP_STRING.

  jsopcode.cpp:6070:45: error: ordered comparison between pointer and zero ('char *' and 'int')
      return QuoteString(&sprinter, s, quote) >= 0;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~

  PR:		215861
  Regressed by:	https://github.com/llvm-mirror/clang/commit/4b6ad14285f3
  Obtained from:	upstream (only the specific fix)
  Approved by:	portmgr blanket
  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2017Q1/
  branches/2017Q1/lang/spidermonkey170/Makefile
  branches/2017Q1/lang/spidermonkey170/files/patch-bug1012971
  branches/2017Q1/lang/spidermonkey24/Makefile
  branches/2017Q1/lang/spidermonkey24/files/patch-bug1012971