Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#54 Compile error with gcc 4.7

open
nobody
None
3
2012-08-31
2012-08-30
Greg
No

Trying to comipile tripwire 2.4.2.2 with gcc 4.7.
No patches applied.
openSUSE 12.2 distro

.g++ -DHAVE_CONFIG_H -I.. -I../.. -fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -O -pipe -Wall -Wno-non-virtual-dtor -c -o integer.o integer.cpp
integer.cpp: In function 'void MontgomeryReduce(word*, word*, const word*, const word*, const word*, unsigned int)':
integer.cpp:743:8: warning: unused variable 'carry' [-Wunused-variable]
integer.cpp: In function 'void CorrectQuotientEstimate(word*, word*, word&, word&, const word*, unsigned int)':
integer.cpp:903:7: warning: unused variable 'borrow' [-Wunused-variable]
integer.cpp: In member function 'Integer& Integer::operator++()':
integer.cpp:1617:8: warning: unused variable 'borrow' [-Wunused-variable]
In file included from modarith.h:9:0,
from integer.cpp:5:
algebra.h: In instantiation of 'T AbstractEuclideanDomain<T>::Gcd(const Element&, const Element&) const [with T = Integer; AbstractEuclideanDomain<T>::Element = Integer]':
integer.cpp:2111:46: required from here
algebra.h:276:2: error: 'Equal' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
algebra.h:276:2: note: declarations in dependent base 'AbstractGroup<Integer>' are not found by unqualified lookup
algebra.h:276:2: note: use 'this->Equal' instead

Discussion

  • Greg
    Greg
    2012-08-31

    This is the patch MINT is using to allow gcc 4.7 to compile. I just added it to the openSUSE package. It looks reasonable to me.

    ===================================================================
    diff -Nur a/src/cryptlib/algebra.h b/src/cryptlib/algebra.h
    --- a/src/cryptlib/algebra.h 2011-11-21 16:06:56.000000000 +0000
    +++ b/src/cryptlib/algebra.h 2012-06-19 14:13:13.930019454 +0000
    @@ -273,7 +273,7 @@
    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;
    diff -Nur a/src/twadmin/twadmincl.cpp b/src/twadmin/twadmincl.cpp
    --- a/src/twadmin/twadmincl.cpp 2011-11-21 16:06:56.000000000 +0000
    +++ b/src/twadmin/twadmincl.cpp 2012-06-19 14:13:40.270019532 +0000
    @@ -33,6 +33,9 @@
    // twadmincl.cpp -- command line parsing for twadmin
    //

    +
    +#include <unistd.h>
    +
    #include "stdtwadmin.h"

    #include "twadmincl.h"

     
  • Greg
    Greg
    2012-08-31

    • priority: 5 --> 3