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

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » CustomBuild

../../bins/zziptest.c:76: error: invalid lvalue in assignmentLast Modified: Mar 7, 2008, 6:54 pm
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 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)
#define I_(_T,_L,_R) _L _R

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.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST