Bug 216215 - astro/gpsbabel: fails to build with clang 4.0
Summary: astro/gpsbabel: 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-18 08:31 UTC by Jan Beich
Modified: 2017-01-31 00:04 UTC (History)
1 user (show)

See Also:
dev2: maintainer-feedback+


Attachments
Proposed patch (1.15 KB, patch)
2017-01-24 15:54 UTC, Oliver Heesakkers
dev2: 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 2017-01-18 08:31:23 UTC
bushnell.cc:138:36: error: ordered comparison between pointer and zero ('const char *' and 'int')
  for (t = bushnell_icons; t->icon > 0; t++) {
                           ~~~~~~~ ^ ~
bushnell.cc:150:36: error: ordered comparison between pointer and zero ('const char *' and 'int')
  for (t = bushnell_icons; t->icon > 0; t++) {
                           ~~~~~~~ ^ ~

build log: http://sprunge.us/MYYK
regressed by: https://github.com/llvm-mirror/clang/commit/4b6ad14285f3
Comment 1 Oliver Heesakkers 2017-01-23 07:39:12 UTC
I'd change the status to in progress, but I don't appear to have the necessary rights. I'll look into it shortly.
Comment 2 Oliver Heesakkers 2017-01-24 15:54:46 UTC
Created attachment 179281 [details]
Proposed patch
Comment 3 Oliver Heesakkers 2017-01-24 16:09:32 UTC
Upstream: https://github.com/gpsbabel/gpsbabel/issues/62

Build success (12 amd64) here: https://secure.ohos.nl/downloads/gpsbabel-1.5.3.log

Further poudriere builds successful for 10 i386, 10 amd64, 11 i386 and 11 amd64
Comment 4 Jan Beich freebsd_committer 2017-01-24 16:26:11 UTC
Comment on attachment 179281 [details]
Proposed patch

nullptr is only available with -std=c++11 or later which this port doesn't pass. libc++ is unaffected due to using surrogate nullptr in C++98 mode unlike libstdc++. GCC defaults to C++98 before 6.0, so the fix would break FreeBSD on powerpc*/mips*/sparc64, DragonFly and users who forced lang/gcc or lang/gcc5.

bushnell.cc: In function 'unsigned int bushnell_get_icon_from_name(QString)':
bushnell.cc:138:39: error: 'nullptr' was not declared in this scope
   for (t = bushnell_icons; t->icon != nullptr; t++) {
                                       ^
bushnell.cc: In function 'const char* bushnell_get_name_from_symbol(int)':
bushnell.cc:150:39: error: 'nullptr' was not declared in this scope
   for (t = bushnell_icons; t->icon != nullptr; t++) {
                                       ^

Note, NULL is promoted to nullptr with -std=c++11 on FreeBSD since 9.1 (see base r228918).
Comment 5 commit-hook freebsd_committer 2017-01-24 16:38:57 UTC
A commit references this bug:

Author: jbeich
Date: Tue Jan 24 16:38:23 UTC 2017
New revision: 432358
URL: https://svnweb.freebsd.org/changeset/ports/432358

Log:
  astro/gpsbabel: unbreak with clang 4.0

  bushnell.cc:138:36: error: ordered comparison between pointer and zero ('const char *' and 'int')
    for (t = bushnell_icons; t->icon > 0; t++) {
                             ~~~~~~~ ^ ~
  bushnell.cc:150:36: error: ordered comparison between pointer and zero ('const char *' and 'int')
    for (t = bushnell_icons; t->icon > 0; t++) {
                             ~~~~~~~ ^ ~

  PR:		216215
  Submitted by:	Oliver Heesakkers <dev2@heesakkers.info> (maintainer)

Changes:
  head/astro/gpsbabel/files/patch-bushnell.cc
Comment 6 Jan Beich freebsd_committer 2017-01-24 16:42:56 UTC
Thanks. Landed.
Comment 7 commit-hook freebsd_committer 2017-01-24 16:43:02 UTC
A commit references this bug:

Author: jbeich
Date: Tue Jan 24 16:42:43 UTC 2017
New revision: 432359
URL: https://svnweb.freebsd.org/changeset/ports/432359

Log:
  MFH: r432358

  astro/gpsbabel: unbreak with clang 4.0

  bushnell.cc:138:36: error: ordered comparison between pointer and zero ('const char *' and 'int')
    for (t = bushnell_icons; t->icon > 0; t++) {
                             ~~~~~~~ ^ ~
  bushnell.cc:150:36: error: ordered comparison between pointer and zero ('const char *' and 'int')
    for (t = bushnell_icons; t->icon > 0; t++) {
                             ~~~~~~~ ^ ~

  PR:		216215
  Submitted by:	Oliver Heesakkers <dev2@heesakkers.info> (maintainer)
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2017Q1/
  branches/2017Q1/astro/gpsbabel/files/patch-bushnell.cc