Bug 230462 - x11/kdelibs-kde4: fails to build with clang 7
Summary: x11/kdelibs-kde4: fails to build with clang 7
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: kde
URL:
Keywords: needs-patch
Depends on:
Blocks: 230355
  Show dependency treegraph
 
Reported: 2018-08-08 17:13 UTC by Jan Beich
Modified: 2018-08-27 13:51 UTC (History)
1 user (show)

See Also:
tcberner: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2018-08-08 17:13:29 UTC
$ poudriere jail -cj clang7 -a amd64 -v projects/clang700-import -m svn+https
$ poudriere testport -j clang7 x11/kdelibs-kde4
[...]
kdecore/localization/klocale_kde.cpp:2441:59: error: ordered comparison between pointer and zero ('const void *' and 'int')
    if ((timeFormat().contains(QString::fromLatin1("%I")) > 0) ||
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
kdecore/localization/klocale_kde.cpp:2442:59: error: ordered comparison between pointer and zero ('const void *' and 'int')
        (timeFormat().contains(QString::fromLatin1("%l")) > 0)) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~

build log: https://ptpb.pw/Hvuj
Comment 1 Tobias C. Berner freebsd_committer 2018-08-08 17:50:23 UTC
Hi there

Can you give me a patch to get clang7 built, to test a fix?


mfg Tobias
Comment 2 Jan Beich freebsd_committer 2018-08-08 18:01:16 UTC
Use /projects/clang700-import branch instead of /head or if you really want /head then try the following

  $ svn diff --patch-compatible svn://svn.freebsd.org/base/head@r337285 svn://svn.freebsd.org/base/projects/clang700-import@337355 | xz -T0 >/path/to/clang7.diff.xz
  $ du -Ah /path/to/clang7.diff.xz
  7.4M    /path/to/clang7.diff.xz
  $ xzcat /path/to/clang7.diff.xz | patch -Efsp0 -d /usr/src
Comment 3 Tobias C. Berner freebsd_committer 2018-08-08 18:06:11 UTC
Sorry, I blindly overlooked the poudriere -cj line *head->wall*
Comment 4 commit-hook freebsd_committer 2018-08-23 21:29:50 UTC
A commit references this bug:

Author: adridg
Date: Thu Aug 23 21:29:11 UTC 2018
New revision: 477926
URL: https://svnweb.freebsd.org/changeset/ports/477926

Log:
  Massage strange comparison for clang7

  kdecore/localization/klocale_kde.cpp:2441:59: error: ordered comparison between pointer and zero ('const void *' and 'int')
      if ((timeFormat().contains(QString::fromLatin1("%I")) > 0) ||
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~

  contains() returns bool or QBool, so this was weird to begin with.

  PR:		230462
  Reported by:	jbeich

Changes:
  head/x11/kdelibs-kde4/Makefile
  head/x11/kdelibs-kde4/files/patch-kdecore_localization_klocale__kde.cpp
Comment 5 Antoine Brodin freebsd_committer 2018-08-24 08:39:41 UTC
More failure:


/wrkdirs/usr/ports/x11/kdelibs-kde4/work/kdelibs-4.14.38/kio/kfile/kopenwithdialog.cpp:716:92: error: ordered comparison between pointer and zero ('const void *' and 'int')
        d->nocloseonexit->setChecked((terminalOptions.contains(QLatin1String("--noclose")) > 0));
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~