Bug 216215

Summary: astro/gpsbabel: fails to build with clang 4.0
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Jan Beich <jbeich>
Status: Closed FIXED    
Severity: Affects Only Me CC: dev2
Priority: --- Keywords: needs-patch
Version: LatestFlags: dev2: maintainer-feedback+
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215861
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216015
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216046
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216051
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216052
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216056
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216058
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216072
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216074
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216075
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216076
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216159
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216176
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216194
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216197
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216198
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216199
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216200
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216203
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216206
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216211
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216213
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216214
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216216
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216217
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216218
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216221
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216222
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216227
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216228
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216233
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216234
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216235
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216253
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216354
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216355
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216356
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216357
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216358
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216615
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216617
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216618
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216619
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216620
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216621
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216622
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216623
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216624
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216626
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216627
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216629
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216630
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216631
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216632
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216633
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216634
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216635
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216636
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216637
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216638
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216639
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216640
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216641
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216642
Bug Depends on:    
Bug Blocks: 216008    
Attachments:
Description Flags
Proposed patch dev2: maintainer-approval+

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