../../bins/zziptest.c:76: error: invalid lvalue in assignment

if you see an error like this one when compiling zzip:

gcc -DHAVE_CONFIG_H -I.. -I../..       -O2 -D_USE_MMAP  -fomit-frame-pointer -Wall -Wstrict-prototypes -Wpointer-arith -Wsign-compare -Wmissing-declarations -c `test -f ../../bins/zziptest.c || echo '../../bins/'`../../bins/zziptest.c
../../bins/zziptest.c: In function 'main':
../../bins/zziptest.c:76: error: invalid lvalue in assignment
make[3]: *** [zziptest.o] Error 1

Then you'll need to type the following.

cd /usr/local/directadmin/customapache/zziplib-0.10.82
wget -O bins/zziptest.c http://zziplib.sourceforge.net/zziptest.c
make
make install

assuming you're using zziplib-0.10.82.
Note, the main changes are to insert:

#if __GNUC__+0 >= 3 && __GNUC_MINOR__+0 >= 3
# ifdef DEBUG
# warning suppress a warning where the compiler should have optimized instead.
# endif
#define I_(_T,_L,_R) do { _T _l = (_T) _L; \
_l _R; _L = (typeof(_L)) _l; } while(0)
#else
#define I_(_T,_L,_R) _L _R
#endif

just below if #endif after "#define O_BINARY 0" in the bins/zziptest.c file.

Then change the line:

(char *)hdr += hdr->d_reclen;

to read:

I_(char *, hdr, += hdr->d_reclen);

the issue appears to be a casting issue, where the compiler wasn't letting the programmer do exactly what he wanted to.  This issue has been known to occur on Fedora 8 boxes and some 64-bit OS machines.


Was this article helpful?

mood_bad Dislike 1
mood Like 0
visibility Views: 12314