From owner-freebsd-ports@FreeBSD.ORG Sun Jun 15 00:22:20 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B73C1AB3; Sun, 15 Jun 2014 00:22:20 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 58B9B2CAA; Sun, 15 Jun 2014 00:22:20 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::a5c4:fe4a:da7a:afad] (unknown [IPv6:2001:7b8:3a7:0:a5c4:fe4a:da7a:afad]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0699E5C37; Sun, 15 Jun 2014 02:22:14 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_E85F31BE-685C-439C-8798-84D376960C2E"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: security/tripwire compile error From: Dimitry Andric In-Reply-To: <201406140542.s5E5gBJX023371@slippy.cwsent.com> Date: Sun, 15 Jun 2014 02:21:59 +0200 Message-Id: <7B4D49CC-FBB0-4930-8045-23F69BCC2EB3@FreeBSD.org> References: <201406140542.s5E5gBJX023371@slippy.cwsent.com> To: Cy Schubert X-Mailer: Apple Mail (2.1878.2) Cc: Greg Rivers , freebsd-ports@freebsd.org, cy@FreeBSD.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jun 2014 00:22:20 -0000 --Apple-Mail=_E85F31BE-685C-439C-8798-84D376960C2E Content-Type: multipart/mixed; boundary="Apple-Mail=_CC8CCFCF-BFF7-41F5-B574-F1FABF1D86C2" --Apple-Mail=_CC8CCFCF-BFF7-41F5-B574-F1FABF1D86C2 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 14 Jun 2014, at 07:42, Cy Schubert wrote: > In message , Greg > Rivers > writes: >> On Fri, 13 Jun 2014, Cy Schubert wrote: >> >>> Try it with gcc 4.6. >>> >> That works fine. I see you've already updated the make file too. >> Thanks a lot for your work. > > Ultimately work needs to be put in to get it to compile with a newer gcc > and with clang. It's on my todo list. I spent a bit of time to make it compile with clang, and also gcc 4.8; please review the attached diff. This also fixes several of the most egregious warnings. -Dimitry --Apple-Mail=_CC8CCFCF-BFF7-41F5-B574-F1FABF1D86C2 Content-Disposition: attachment; filename=security__tripwire-fix-c++-problems-1.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="security__tripwire-fix-c++-problems-1.diff" Content-Transfer-Encoding: 7bit Index: security/tripwire/Makefile =================================================================== --- security/tripwire/Makefile (revision 357663) +++ security/tripwire/Makefile (working copy) @@ -18,7 +18,6 @@ MAKE_JOBS_UNSAFE= yes USES= gmake tar:bzip2 GNU_CONFIGURE= yes -USE_GCC= any MAKE_ARGS= SYSPRE=${ARCH}-unknown-freebsd \ DESTDIR=${STAGEDIR} IS_INTERACTIVE= yes Index: security/tripwire/files/patch-src-core-archive.cpp =================================================================== --- security/tripwire/files/patch-src-core-archive.cpp (revision 0) +++ security/tripwire/files/patch-src-core-archive.cpp (working copy) @@ -0,0 +1,13 @@ +--- src/core/archive.cpp.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/core/archive.cpp 2014-06-15 01:45:01.000000000 +0200 +@@ -886,8 +886,8 @@ void cLockedTemporaryFileArchive::OpenRe + catch( eFSServices& e) + { + TSTRING errStr = TSS_GetString( cCore, core::STR_BAD_TEMPDIRECTORY ); +- eArchiveOpen e(strTempFile, errStr); +- throw e; ++ eArchiveOpen e2(strTempFile, errStr); ++ throw e2; + } + } + /////////////////////////////////////////////////////////////////////////////// Index: security/tripwire/files/patch-src-core-archive.h =================================================================== --- security/tripwire/files/patch-src-core-archive.h (revision 0) +++ security/tripwire/files/patch-src-core-archive.h (working copy) @@ -0,0 +1,11 @@ +--- src/core/archive.h.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/core/archive.h 2014-06-15 01:51:40.000000000 +0200 +@@ -85,6 +85,8 @@ TSS_EXCEPTION( eArchiveStringTooLong, eA + class cArchive + { + public: ++ virtual ~cArchive() {} ++ + // convenience methods + // + // Specific Read functions throw(eArchive) if EOF is reached because Index: security/tripwire/files/patch-src-core-displayencoder.cpp =================================================================== --- security/tripwire/files/patch-src-core-displayencoder.cpp (revision 0) +++ security/tripwire/files/patch-src-core-displayencoder.cpp (working copy) @@ -0,0 +1,16 @@ +--- src/core/displayencoder.cpp.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/core/displayencoder.cpp 2014-06-15 01:46:55.000000000 +0200 +@@ -825,11 +825,10 @@ bool cEncoder::OnlyOneCatagoryPerChar() + { + bool fFailedATest = false; + +- ach[0] = ch; ++ TSTRING ach(1, ch); + for( sack_type::const_iterator atE = m_encodings.begin(); atE != m_encodings.end(); atE++ ) + { +- TSTRING::const_iterator first(&ach[0]), last(&ach[1]); +- if( (*atE)->NeedsEncoding( first, last ) ) ++ if( (*atE)->NeedsEncoding( ach.begin(), ach.end() ) ) + { + if( fFailedATest ) + return false; // each char can only fail one test Index: security/tripwire/files/patch-src-core-fsservices.h =================================================================== --- security/tripwire/files/patch-src-core-fsservices.h (revision 0) +++ security/tripwire/files/patch-src-core-fsservices.h (working copy) @@ -0,0 +1,19 @@ +--- src/core/fsservices.h.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/core/fsservices.h 2014-06-15 01:54:49.000000000 +0200 +@@ -177,6 +177,7 @@ TSS_FILE_EXCEPTION( eFSServicesGeneric, + class iFSServices + { + public: ++ virtual ~iFSServices() {} + + /////////////////////////////////////////////////////////////// + // ENUMS +@@ -219,7 +220,7 @@ class iFSServices + // returns true if the file system is case sensitive + virtual TCHAR GetPathSeperator() const = 0; + // returns "/" for unix and "\\" for win32 +- virtual TCHAR* GetStandardBackupExtension() const = 0; ++ virtual const TCHAR* GetStandardBackupExtension() const = 0; + // returns normal string to append to backup files for this os. + + //////////////////////////////////////// Index: security/tripwire/files/patch-src-core-tw_signal.cpp =================================================================== --- security/tripwire/files/patch-src-core-tw_signal.cpp (revision 0) +++ security/tripwire/files/patch-src-core-tw_signal.cpp (working copy) @@ -0,0 +1,11 @@ +--- src/core/tw_signal.cpp.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/core/tw_signal.cpp 2014-06-15 01:48:28.000000000 +0200 +@@ -79,7 +79,7 @@ void util_SignalHandler( int sig ) + #if IS_UNIX + void tw_psignal(int sig, const TCHAR *str) + { +- TCHAR *siglist[NSIG] = { ++ const TCHAR *siglist[NSIG] = { + _T("Unknown Signal"), + _T("Hangup"), + _T("Interrupt"), Index: security/tripwire/files/patch-src-core-twlocale.h =================================================================== --- security/tripwire/files/patch-src-core-twlocale.h (revision 0) +++ security/tripwire/files/patch-src-core-twlocale.h (working copy) @@ -0,0 +1,11 @@ +--- src/core/twlocale.h.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/core/twlocale.h 2014-06-15 01:48:46.000000000 +0200 +@@ -110,7 +110,7 @@ namespace tss + #if USE_STD_CPP_LOCALE_WORKAROUND + return std::use_facet( l, pf ); + #else +- return std::use_facet< FacetT >( l ); pf; // This is C++ standard ++ return std::use_facet< FacetT >( l ); (void)pf; // This is C++ standard + #endif + } + } Index: security/tripwire/files/patch-src-core-unixfsservices.cpp =================================================================== --- security/tripwire/files/patch-src-core-unixfsservices.cpp (revision 0) +++ security/tripwire/files/patch-src-core-unixfsservices.cpp (working copy) @@ -0,0 +1,11 @@ +--- src/core/unixfsservices.cpp.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/core/unixfsservices.cpp 2014-06-15 01:44:45.000000000 +0200 +@@ -792,7 +792,7 @@ bool cUnixFSServices::FullPath( TSTRING& + // Returns normal string to append to backup files for this os. + // (e.g. "~" for unix and ".bak" for winos) + /////////////////////////////////////////////////////////////////////////////// +-TCHAR* cUnixFSServices::GetStandardBackupExtension() const ++const TCHAR* cUnixFSServices::GetStandardBackupExtension() const + { + return _T(".bak"); + } Index: security/tripwire/files/patch-src-core-unixfsservices.h =================================================================== --- security/tripwire/files/patch-src-core-unixfsservices.h (revision 0) +++ security/tripwire/files/patch-src-core-unixfsservices.h (working copy) @@ -0,0 +1,11 @@ +--- src/core/unixfsservices.h.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/core/unixfsservices.h 2014-06-15 01:44:45.000000000 +0200 +@@ -99,7 +99,7 @@ class cUnixFSServices : public iFSServic + //////////////////////////////////////// + virtual bool IsCaseSensitive() const; + // returns true if the file system is case sensitive +- virtual TCHAR* GetStandardBackupExtension() const; ++ virtual const TCHAR* GetStandardBackupExtension() const; + // returns normal string to append to backup files for this os. + // (e.g. "~" for unix and ".bak" for winos) + virtual TCHAR GetPathSeperator() const; Index: security/tripwire/files/patch-src-cryptlib-algebra.h =================================================================== --- security/tripwire/files/patch-src-cryptlib-algebra.h (revision 0) +++ security/tripwire/files/patch-src-cryptlib-algebra.h (working copy) @@ -0,0 +1,11 @@ +--- src/cryptlib/algebra.h.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/cryptlib/algebra.h 2014-06-15 01:42:42.000000000 +0200 +@@ -273,7 +273,7 @@ template T AbstractEuclideanDo + Element g[3]={b, a}; + unsigned int i0=0, i1=1, i2=2; + +- while (!Equal(g[i1], this->Zero())) ++ while (!this->Equal(g[i1], this->Zero())) + { + g[i2] = Mod(g[i0], g[i1]); + unsigned int t = i0; i0 = i1; i1 = i2; i2 = t; Index: security/tripwire/files/patch-src-cryptlib-cryptlib.cpp =================================================================== --- security/tripwire/files/patch-src-cryptlib-cryptlib.cpp (revision 0) +++ security/tripwire/files/patch-src-cryptlib-cryptlib.cpp (working copy) @@ -0,0 +1,13 @@ +--- src/cryptlib/cryptlib.cpp.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/cryptlib/cryptlib.cpp 2014-06-15 01:42:35.000000000 +0200 +@@ -43,8 +43,8 @@ void StreamCipher::ProcessString(byte *o + + void StreamCipher::ProcessString(byte *inoutString, unsigned int length) + { +- while(length--) +- *inoutString++ = ProcessByte(*inoutString); ++ for(;length--; inoutString++) ++ *inoutString = ProcessByte(*inoutString); + } + + bool MessageAuthenticationCode::Verify(const byte *macIn) Index: security/tripwire/files/patch-src-fco-fcospec.cpp =================================================================== --- security/tripwire/files/patch-src-fco-fcospec.cpp (revision 0) +++ security/tripwire/files/patch-src-fco-fcospec.cpp (working copy) @@ -0,0 +1,10 @@ +--- src/fco/fcospec.cpp.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/fco/fcospec.cpp 2014-06-15 01:50:46.000000000 +0200 +@@ -51,6 +51,7 @@ + class cDefaultSpecMask : public iFCOSpecMask + { + public: ++ cDefaultSpecMask() {} + virtual const TSTRING& GetName() const; + virtual bool Accept(const iFCO* pFCO) const; + private: Index: security/tripwire/files/patch-src-fco-parsergenreutil.h =================================================================== --- security/tripwire/files/patch-src-fco-parsergenreutil.h (revision 0) +++ security/tripwire/files/patch-src-fco-parsergenreutil.h (working copy) @@ -0,0 +1,10 @@ +--- src/fco/parsergenreutil.h.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/fco/parsergenreutil.h 2014-06-15 01:55:46.000000000 +0200 +@@ -53,6 +53,7 @@ class cFCOName; + class iParserGenreUtil + { + public: ++ virtual ~iParserGenreUtil() {} + virtual bool MapStringToProperty( const TSTRING& str, int& propIndex ) const = 0; + // maps the given string to an index into a property vector for the genre + virtual void AddSubTypeProps( cFCOPropVector& v ) const = 0; Index: security/tripwire/files/patch-src-tripwire-mailmessage.cpp =================================================================== --- security/tripwire/files/patch-src-tripwire-mailmessage.cpp (revision 0) +++ security/tripwire/files/patch-src-tripwire-mailmessage.cpp (working copy) @@ -0,0 +1,11 @@ +--- src/tripwire/mailmessage.cpp.orig 2011-11-21 17:06:56.000000000 +0100 ++++ src/tripwire/mailmessage.cpp 2014-06-15 01:56:20.000000000 +0200 +@@ -258,7 +258,7 @@ bool cMailMessageUtil::ReadDate( TSTRING + } + + +-static char* util_Get_IANA_CharSet() ++static const char* util_Get_IANA_CharSet() + { + const char* pCP = setlocale( LC_CTYPE, NULL ); + --Apple-Mail=_CC8CCFCF-BFF7-41F5-B574-F1FABF1D86C2 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_CC8CCFCF-BFF7-41F5-B574-F1FABF1D86C2-- --Apple-Mail=_E85F31BE-685C-439C-8798-84D376960C2E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlOc5zQACgkQsF6jCi4glqNRUACfc/MsFfbBFdK2eZj+xtdOJ49R QksAoImZmhoXbwug7PappXDB224sXK3N =5tR5 -----END PGP SIGNATURE----- --Apple-Mail=_E85F31BE-685C-439C-8798-84D376960C2E--