Discussion:
problem compiling SFS with gcc 4.0 (fedora core 4)
Nikolaos Michalakis
2005-07-24 19:14:19 UTC
Permalink
Hi,

I 've downloaded SFS from CVS and trying to compile it for Fedora Core 4.
gcc 4.0 seems to be very picky and I constantly get compilation errors so I
have to modify the source
to move on. Has anyone succeeded compiling SFS with gcc 4.0?

I am currently stuck on this error and I can't track it down:
if /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.
-I.. -I/usr/include/db4 -DSLEEPYCAT -I.. -I../async -I../arpc -I../crypt
-I../sfsmisc -I../sfsrodb -I../adb -I../svc -I../svc
-DEXECDIR=\"/usr/local/lib/sfs-0.8pre\" -DETCDIR=\"/etc/sfs\"
-DDATADIR=\"/usr/local/share/sfs\" -DPIDDIR=\"/var/run\"
-DSFSDIR=\"/var/sfs\" -g -O2 -Wall -Werror -MT modalg.lo -MD -MP -MF
".deps/modalg.Tpo" -c -o modalg.lo modalg.C; \
then mv -f ".deps/modalg.Tpo" ".deps/modalg.Plo"; else rm -f
".deps/modalg.Tpo"; exit 1; fi
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/db4 -DSLEEPYCAT -I..
-I../async -I../arpc -I../crypt -I../sfsmisc -I../sfsrodb -I../adb -I../svc
-I../svc -DEXECDIR=\"/usr/local/lib/sfs-0.8pre\" -DETCDIR=\"/etc/sfs\"
-DDATADIR=\"/usr/local/share/sfs\" -DPIDDIR=\"/var/run\"
-DSFSDIR=\"/var/sfs\" -g -O2 -Wall -Werror -MT modalg.lo -MD -MP -MF
.deps/modalg.Tpo -c modalg.C -o modalg.o
modalg.C:64: error: '<anonymous enum>' is/uses anonymous type
modalg.C:64: error: trying to instantiate 'template<class T> const traceobj&
operator<<(const traceobj&, const T&)'
modalg.C:64: error: '<anonymous enum>' is/uses anonymous type
modalg.C:64: error: trying to instantiate 'template<class T> const strbuf&
operator<<(const strbuf&, const T&)'
make: *** [modalg.lo] Error 1

Any help would be most welcome
Jaakko Niemi
2005-07-27 00:37:29 UTC
Permalink
Post by Nikolaos Michalakis
Hi,
I 've downloaded SFS from CVS and trying to compile it for Fedora Core 4.
gcc 4.0 seems to be very picky and I constantly get compilation errors so I
have to modify the source
to move on. Has anyone succeeded compiling SFS with gcc 4.0?
..
Post by Nikolaos Michalakis
modalg.C:64: error: '<anonymous enum>' is/uses anonymous type
I worked around this with the patch below. Altough I cannot
see how this could break things, I'm not sure if this is the
right solution.

--j

--- sfs1-june/crypt/bigint.h 2005-06-05 18:59:58.000000000 +0300
+++ sfs1/crypt/bigint.h 2005-07-27 02:08:11.000000000 +0300
@@ -44,7 +44,7 @@
#undef ABS
#define ABS(a) ((a) < 0 ? -(a) : (a))

-enum { mpz_bitsperlimb = sizeof (mp_limb_t) * 8 };
+enum named { mpz_bitsperlimb = sizeof (mp_limb_t) * 8 };

int mpz_getbit (const MP_INT *, size_t);
void mpz_xor (MP_INT *, const MP_INT *, const MP_INT *);

Loading...