Bug 230626 - devel/libzim: fails to build with Clang 7
Summary: devel/libzim: 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: Steve Wills
URL:
Keywords: needs-patch
Depends on:
Blocks: 230355
  Show dependency treegraph
 
Reported: 2018-08-14 19:50 UTC by Jan Beich
Modified: 2018-08-15 17:03 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (swills)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2018-08-14 19:50:24 UTC
$ poudriere jail -cj clang7 -a amd64 -v projects/clang700-import -m svn+https
$ poudriere testport -j clang7 devel/libzim
[...]
c++ -Isrc/src@@zim@sha -Isrc -I../src -Iinclude -I../include -Istatic -I/usr/local/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Werror -std=c++11 -O3 -O2 -fstack-protector -fno-strict-aliasing -fPIC -pthread  -MD -MQ 'src/src@@zim@sha/fileimpl.cpp.o' -MF 'src/src@@zim@sha/fileimpl.cpp.o.d' -o 'src/src@@zim@sha/fileimpl.cpp.o' -c ../src/fileimpl.cpp
../src/fileimpl.cpp:75:13: error: local variable 'e' will be copied despite being thrown by name [-Werror,-Wreturn-std-move]
      throw e;
            ^
../src/fileimpl.cpp:75:13: note: call 'std::move' explicitly to avoid copying
      throw e;
            ^
            std::move(e)

http://package18.nyi.freebsd.org/data/headamd64PR230355-default/2018-08-11_19h01m06s/logs/errors/libzim-4.0.0_1.log
Comment 1 Jan Beich freebsd_committer freebsd_triage 2018-08-14 19:52:08 UTC
-Werror shouldn't be enabled outside of maintainer mode for unimportant warnings (e.g., -Wall) as it tends to break build on each compiler upgrade/change/etc. If you really care about every warning report upstream after confirming it affects development version.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2018-08-14 19:59:03 UTC
-Wall + -Werror also breaks platforms stuck on GCC (powerpc*, mips*, sparc64).

../src/fileimpl.cpp: In constructor 'zim::FileImpl::FileImpl(const string&)':
../src/fileimpl.cpp:74:33: error: catching polymorphic type 'class zim::ZimFileFormatError' by value [-Werror=catch-value=]
     } catch (ZimFileFormatError e) {
                                 ^
../src/fileimpl.cpp: In member function 'std::shared_ptr<const zim::Dirent> zim::FileImpl::getDirent(zim::article_index_t)':
../src/fileimpl.cpp:301:18: error: catching polymorphic type 'class zim::InvalidSize' by value [-Werror=catch-value=]
         } catch (InvalidSize) {
                  ^~~~~~~~~~~
../src/fileimpl.cpp: In member function 'std::__cxx11::string zim::FileImpl::getChecksum()':
../src/fileimpl.cpp:496:14: error: catching polymorphic type 'class zim::BufferError' by value [-Werror=catch-value=]
     } catch (BufferError)
              ^~~~~~~~~~~
cc1plus: all warnings being treated as errors
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-08-15 17:02:23 UTC
A commit references this bug:

Author: swills
Date: Wed Aug 15 17:02:12 UTC 2018
New revision: 477240
URL: https://svnweb.freebsd.org/changeset/ports/477240

Log:
  devel/libzim: Remove -Werror from the build flags

  Fixes build with Clang 7

  PR:		230626

Changes:
  head/devel/libzim/files/patch-meson.build