Bug 219281

Summary: net-p2p/verlihub-plugins-floodprotect: fails to build with lang/gcc6 or later
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Raphael Kubo da Costa <rakuco>
Status: Closed FIXED    
Severity: Affects Only Me CC: gerald, me, rakuco
Priority: --- Flags: rakuco: maintainer-feedback-
rakuco: merge-quarterly-
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219279
Bug Depends on:    
Bug Blocks: 219275    
Attachments:
Description Flags
Proposed patch koobs: maintainer-approval+

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.