Bug 219281 - net-p2p/verlihub-plugins-floodprotect: fails to build with lang/gcc6 or later
Summary: net-p2p/verlihub-plugins-floodprotect: fails to build with lang/gcc6 or later
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: Raphael Kubo da Costa
URL:
Keywords:
Depends on:
Blocks: 219275
  Show dependency treegraph
 
Reported: 2017-05-14 18:00 UTC by Jan Beich
Modified: 2017-08-01 09:05 UTC (History)
3 users (show)

See Also:
rakuco: maintainer-feedback-
rakuco: merge-quarterly-


Attachments
Proposed patch (438 bytes, patch)
2017-07-28 13:53 UTC, Raphael Kubo da Costa
koobs: 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 freebsd_triage 2017-05-14 18:00:27 UTC
In file included from /usr/local/include/verlihub/tcache.h:26:0,
                 from /usr/local/include/verlihub/cpenaltylist.h:29,
                 from /usr/local/include/verlihub/cuser.h:30,
                 from /usr/local/include/verlihub/cconndc.h:24,
                 from cfloodprotect.cpp:13:
/usr/local/include/verlihub/thasharray.h: In instantiation of 'DataType nUtils::tHashArray<DataType>::GetByHash(const tHashType&) [with DataType = short int; nUtils::tHashArray<DataType>::tHashType = long unsigned int]':
cfloodprotect.cpp:228:48:   required from here
/usr/local/include/verlihub/thasharray.h:338:29: error: cast from 'std::nullptr_t' to 'short int' loses precision [-fpermissive]
   if (Items == NULL) return (DataType)NULL;
                             ^
/usr/local/include/verlihub/thasharray.h: In instantiation of 'bool nUtils::tHashArray<DataType>::ContainsHash(const tHashType&) [with DataType = short int; nUtils::tHashArray<DataType>::tHashType = long unsigned int]':
cfloodprotect.cpp:236:46:   required from here
/usr/local/include/verlihub/thasharray.h:331:11: error: cast from 'std::nullptr_t' to 'short int' loses precision [-fpermissive]
   return ((DataType)NULL != Items->Find(Hash));
           ^
/usr/local/include/verlihub/thasharray.h: In instantiation of 'bool nUtils::tHashArray<DataType>::AddWithHash(DataType, const tHashType&) [with DataType = short int; nUtils::tHashArray<DataType>::tHashType = long unsigned int]':
cfloodprotect.cpp:240:53:   required from here
/usr/local/include/verlihub/thasharray.h:267:15: error: cast from 'std::nullptr_t' to 'short int' loses precision [-fpermissive]
   if (Data == (DataType)NULL) return false;
               ^
/usr/local/include/verlihub/thasharray.h:283:8: error: cast from 'std::nullptr_t' to 'short int' loses precision [-fpermissive]
   if ( (DataType)NULL == Items->AddData(Data, Hash))
        ^
/usr/local/include/verlihub/thasharray.h: In instantiation of 'bool nUtils::tHashArray<DataType>::RemoveByHash(const tHashType&) [with DataType = short int; nUtils::tHashArray<DataType>::tHashType = long unsigned int]':
cfloodprotect.cpp:248:51:   required from here
/usr/local/include/verlihub/thasharray.h:314:8: error: cast from 'std::nullptr_t' to 'short int' loses precision [-fpermissive]
   if ( (DataType)NULL != Data )
        ^
In file included from /usr/local/lib/gcc6/gcc/x86_64-portbld-freebsd11.0/6.3.0/include-fixed/wchar.h:73:0,
                 from /usr/local/lib/gcc6/include/c++/cwchar:44,
                 from /usr/local/lib/gcc6/include/c++/bits/postypes.h:40,
                 from /usr/local/lib/gcc6/include/c++/bits/char_traits.h:40,
                 from /usr/local/lib/gcc6/include/c++/string:40,
                 from /usr/local/include/verlihub/ckick.h:26,
                 from cfloodprotect.cpp:11:
/usr/local/include/verlihub/thasharray.h: In instantiation of 'DataType nUtils::tHashArray<DataType>::sItem::Set(nUtils::tHashArray<DataType>::tHashType, const DataType&) [with DataType = short int; nUtils::tHashArray<DataType>::tHashType = long unsigned int]':
/usr/local/include/verlihub/thasharray.h:347:32:   required from 'bool nUtils::tHashArray<DataType>::SetByHash(const tHashType&, const DataType&) [with DataType = short int; nUtils::tHashArray<DataType>::tHashType = long unsigned int]'
cfloodprotect.cpp:241:44:   required from here
/usr/local/include/verlihub/thasharray.h:174:23: error: cannot convert 'std::nullptr_t' to 'short int' in initialization
    DataType _result = NULL;
                       ^
In file included from /usr/local/include/verlihub/tcache.h:26:0,
                 from /usr/local/include/verlihub/cpenaltylist.h:29,
                 from /usr/local/include/verlihub/cuser.h:30,
                 from /usr/local/include/verlihub/cconndc.h:24,
                 from cfloodprotect.cpp:13:
/usr/local/include/verlihub/thasharray.h: In instantiation of 'DataType nUtils::tHashArray<DataType>::sItem::DeleteHash(nUtils::tHashArray<DataType>::tHashType, nUtils::tHashArray<DataType>::sItem*&) [with DataType = short int; nUtils::tHashArray<DataType>::tHashType = long unsigned int]':
/usr/local/include/verlihub/thasharray.h:306:47:   required from 'bool nUtils::tHashArray<DataType>::RemoveByHash(const tHashType&) [with DataType = short int; nUtils::tHashArray<DataType>::tHashType = long unsigned int]'
cfloodprotect.cpp:248:51:   required from here
/usr/local/include/verlihub/thasharray.h:214:20: error: cast from 'std::nullptr_t' to 'short int' loses precision [-fpermissive]
    DataType Data = (DataType)NULL;
                    ^

build log: http://sprunge.us/jTUV
Comment 1 Mikle Davidkin 2017-05-14 18:50:53 UTC
Actually all Verlihub plugins are outdated and have to be deprecated. Most recent Verlihub version doesn't support these plugins and include all working ones inside itself. I already have working port of it and will submit PR soon after some testing. Main Verlihub port update implies delete all verlihub-plugin ports.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2017-07-16 19:50:47 UTC
(In reply to Mikle Davidkin from comment #1)
> I already have working port of it and will submit PR
> soon after some testing.

Any progress since then?
Comment 3 Raphael Kubo da Costa freebsd_committer freebsd_triage 2017-07-28 13:53:56 UTC
Created attachment 184801 [details]
Proposed patch

The attached patch makes the port build with an older C++ standard (the one GCC used before GCC 6) to avoid C++11/14 errors. It worked fine on Poudriere (HEAD-amd64).
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2017-08-01 05:31:15 UTC
Comment on attachment 184801 [details]
Proposed patch

Approved by: portmgr (blanket)
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-08-01 09:05:04 UTC
A commit references this bug:

Author: rakuco
Date: Tue Aug  1 09:04:35 UTC 2017
New revision: 447015
URL: https://svnweb.freebsd.org/changeset/ports/447015

Log:
  Explicitly build with -std=gnu++03.

  This fixes the build with GCC 6, which defaults to -std=gnu++14. The project
  seems to be incompatible with C++11 and later.

  PR:		219281
  Approved by:	portmgr (blanket approval)

Changes:
  head/net-p2p/verlihub-plugins-floodprotect/Makefile
Comment 6 Raphael Kubo da Costa freebsd_committer freebsd_triage 2017-08-01 09:05:37 UTC
Setting merge-quarterly-. The rationale from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219484#c23 also applies to this bug.