Bug 197857

Summary: Fix www/libxul build with clang 3.6.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: freebsd-gecko (Nobody) <gecko>
Status: Closed FIXED    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (gecko)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugzilla.mozilla.org/show_bug.cgi?id=1021171
Bug Depends on:    
Bug Blocks: 197395    
Attachments:
Description Flags
Fix invalid conversions of nullptr to bool in libxul none

Description Dimitry Andric freebsd_committer freebsd_triage 2015-02-20 20:15:15 UTC
Created attachment 153233 [details]
Fix invalid conversions of nullptr to bool in libxul

During the exp-run in bug 197395, it was found that www/libxul gives errors with clang 3.6.0:

http://package18.nyi.freebsd.org/data/headamd64PR197395-default/2015-02-11_23h04m51s/logs/errors/libxul-31.4.0_2.log

These errors are all -Werror warnings, of the form:

/wrkdirs/usr/ports/www/libxul/work/mozilla-esr31/js/src/builtin/TypedObject.cpp:713:16: error: implicit conversion of nullptr constant to 'bool' [-Werror,-Wnull-conversion]
        return nullptr;
        ~~~~~~ ^~~~~~~
               false

where the function is supposed to return bool, not a pointer.  These are bugs in the libxul code.

The attached patch fixes all the instances of those bugs.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-02-20 20:15:15 UTC
Auto-assigned to maintainer gecko@FreeBSD.org
Comment 2 Jan Beich freebsd_committer freebsd_triage 2015-02-21 05:58:13 UTC
Upstream also fixed in
- js/xpconnect/wrappers/XrayWrapper.cpp
- netwerk/ipc/NeckoParent.cpp

I may need to check comm-esr31 code (as in mail/thunderbird) doesn't have more.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-02-21 08:22:40 UTC
A commit references this bug:

Author: jbeich
Date: Sat Feb 21 08:22:29 UTC 2015
New revision: 379485
URL: https://svnweb.freebsd.org/changeset/ports/379485

Log:
  Fix invalid conversions of nullptr to bool to unbreak clang 3.6 build

  PR:		197857
  Submitted by:	dim (initial version)
  Obtained from:	https://github.com/mozilla/gecko-dev/commit/dd19f59

Changes:
  head/mail/thunderbird/files/patch-bug1021171
  head/www/firefox-esr/files/patch-bug1021171
  head/www/libxul/files/patch-bug1021171
Comment 4 Jan Beich freebsd_committer freebsd_triage 2015-02-21 08:23:55 UTC
Thanks. Committed.