After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757672 - pan does not build with clang on NetBSD
pan does not build with clang on NetBSD
Status: RESOLVED FIXED
Product: Pan
Classification: Other
Component: general
unspecified
Other All
: Normal critical
: ---
Assigned To: pan-maint
pan-maint
Depends on:
Blocks:
 
 
Reported: 2015-11-06 09:07 UTC by Thomas Klausner
Modified: 2016-03-18 21:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build log with clang version 3.8 (branches/release_38 r261930) (33.30 KB, text/plain)
2016-03-15 15:47 UTC, Thomas Klausner
  Details
Add ifdef _LIBCPP_VERSION (315 bytes, patch)
2016-03-16 16:07 UTC, Petr Kovar
none Details | Review

Description Thomas Klausner 2015-11-06 09:07:31 UTC
I'm trying to build pan with clang on NetBSD. It builds fine with gcc, so I don't think it's NetBSD-specific.

# clang --version
clang version 3.6 (branches/release_36 237755)
Target: x86_64--netbsd
Thread model: posix

With clang, I see (except for a number of warnings):
In file included from ./filter-info.h:24:
In file included from ../../pan/general/quark.h:35:
/usr/include/c++/ext/hash_set:205:5: warning: Use of the header <ext/hash_set> is deprecated.  Migrate to <unordered_set> [-W#warnings]
#   warning Use of the header <ext/hash_set> is deprecated.  Migrate to <unordered_set>
    ^
In file included from filter-info.cc:26:
In file included from ./filter-info.h:23:
/usr/include/c++/deque:912:49: error: invalid application of 'sizeof' to an incomplete type 'value_type' (aka 'pan::FilterInfo')
    static const difference_type __block_size = sizeof(value_type) < 256 ? 4096 / sizeof(value_type) : 16;
                                                ^~~~~~~~~~~~~~~~~~
/usr/include/c++/deque:1159:15: note: in instantiation of template class 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >' requested here
    : private __deque_base<_Tp, _Allocator>
              ^
./filter-info.h:81:20: note: in instantiation of template class 'std::__1::deque<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >' requested here
      aggregates_t _aggregates;
                   ^
./filter-info.h:34:9: note: definition of 'pan::FilterInfo' is not complete until the closing '}'
  class FilterInfo
        ^
In file included from filter-info.cc:26:
In file included from ./filter-info.h:23:
/usr/include/c++/deque:1169:30: error: '__alloc_traits' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::__alloc_traits        __alloc_traits;
                             ^
./filter-info.h:81:20: note: in instantiation of template class 'std::__1::deque<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >' requested here
      aggregates_t _aggregates;
                   ^
/usr/include/c++/deque:904:54: note: declared protected here
    typedef allocator_traits<allocator_type>         __alloc_traits;
                                                     ^
/usr/include/c++/deque:1170:30: error: 'reference' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::reference             reference;
                             ^
/usr/include/c++/deque:905:54: note: declared protected here
    typedef value_type&                              reference;
                                                     ^
/usr/include/c++/deque:1171:30: error: 'const_reference' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::const_reference       const_reference;
                             ^
/usr/include/c++/deque:906:54: note: declared protected here
    typedef const value_type&                        const_reference;
                                                     ^
/usr/include/c++/deque:1172:30: error: 'iterator' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::iterator              iterator;
                             ^
/usr/include/c++/deque:922:64: note: declared protected here
                             difference_type, __block_size>    iterator;
                                                               ^
/usr/include/c++/deque:1173:30: error: 'const_iterator' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::const_iterator        const_iterator;
                             ^
/usr/include/c++/deque:924:64: note: declared protected here
                             difference_type, __block_size>    const_iterator;
                                                               ^
/usr/include/c++/deque:1174:30: error: 'size_type' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::size_type             size_type;
                             ^
/usr/include/c++/deque:907:54: note: declared protected here
    typedef typename __alloc_traits::size_type       size_type;
                                                     ^
/usr/include/c++/deque:1175:30: error: 'difference_type' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::difference_type       difference_type;
                             ^
/usr/include/c++/deque:908:54: note: declared protected here
    typedef typename __alloc_traits::difference_type difference_type;
                                                     ^
/usr/include/c++/deque:1177:30: error: 'pointer' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::pointer               pointer;
                             ^
/usr/include/c++/deque:909:54: note: declared protected here
    typedef typename __alloc_traits::pointer         pointer;
                                                     ^
/usr/include/c++/deque:1178:30: error: 'const_pointer' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::const_pointer         const_pointer;
                             ^
/usr/include/c++/deque:910:54: note: declared protected here
    typedef typename __alloc_traits::const_pointer   const_pointer;
                                                     ^
/usr/include/c++/deque:1343:30: error: '__map_const_pointer' is a protected member of 'std::__1::__deque_base<pan::FilterInfo, std::__1::allocator<pan::FilterInfo> >'
    typedef typename __base::__map_const_pointer __map_const_pointer;
                             ^
/usr/include/c++/deque:918:81: note: declared protected here
    typedef typename allocator_traits<__const_pointer_allocator>::const_pointer __map_const_pointer;
                                                                                ^
filter-info.cc:293:26: error: member reference type 'aggregates_t::const_iterator' (aka 'int') is not a pointer
      ret += "   " + it->describe() + "\n";
                     ~~  ^
filter-info.cc:300:26: error: member reference type 'aggregates_t::const_iterator' (aka 'int') is not a pointer
      ret += "   " + it->describe() + "\n";
                     ~~  ^
filter-info.cc:307:26: error: member reference type 'aggregates_t::const_iterator' (aka 'int') is not a pointer
      ret += "   " + it->describe() + "\n";
                     ~~  ^
filter-info.cc:314:26: error: member reference type 'aggregates_t::const_iterator' (aka 'int') is not a pointer
      ret += "   " + it->describe() + "\n";
                     ~~  ^
1 warning and 15 errors generated.
Makefile:439: recipe for target 'filter-info.o' failed

These errors also appear in other files (e.g. scorefile.cc).
Comment 1 Thomas Klausner 2015-11-06 09:07:57 UTC
I forgot to mention, that's pan from git as of yesterday.
Comment 2 detlef.graef 2016-03-14 16:02:19 UTC
This problem is fixed in the current version of Pan from the git repository.

I've build Pan successfully with clang on FreeBSD. Please check if you can build Pan on NetBSD.
Comment 3 Thomas Klausner 2016-03-15 15:47:33 UTC
Created attachment 324017 [details]
build log with clang version 3.8 (branches/release_38 r261930)

Thanks for the update.
On NetBSD-7.99.26/amd64 with clang version 3.8 (branches/release_38 r261930), the build progresses further, but fails due to missing ext/algorithm in libc++.

For comparison, gcc on NetBSD has:

/usr/include/g++/ext/algorithm
/usr/include/g++/parallel/algorithm
/usr/include/g++/algorithm

While libc++/clang has:

/usr/include/c++/algorithm
/usr/include/c++/experimental/algorithm

There are lots of other warnings, so I attached the build log.
Comment 4 Petr Kovar 2016-03-15 16:32:41 UTC
See also https://bugzilla.gnome.org/show_bug.cgi?id=712539.
Comment 5 Petr Kovar 2016-03-16 16:07:38 UTC
Created attachment 324116 [details] [review]
Add ifdef _LIBCPP_VERSION

Hi Thomas, could you please git-apply this patch and test it?
Comment 6 Thomas Klausner 2016-03-17 10:09:55 UTC
Thanks, Petr, for the patch. I can confirm that it fixes the build with clang for me.
Comment 7 Petr Kovar 2016-03-18 21:02:39 UTC
I've just committed the fix as 44ffc85e90af75046ca6dc94268b4b9045b5c6d5.

Everybody, thank you for your help.

This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.