[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#314905: xfree86: FTBFS with gcc-4.0: Invalid lvalue in assignment



Package: xfree86
Severity: normal
Version: 4.3.0.dfsg.1-14
Tags: patch

When I try to build xfree86 with gcc-4.0 (on amd64), I get:

...
rm -f tdfx_span.o
gcc -c -O2 -g -ansi -pedantic -Wall -Wpointer-arith -Wstrict-prototypes          -Wmissing-prototypes -Wmissing-declarations                      -Wredundant-decls -Wnested-externs -Wundef  -I../../../../../../exports/include/X11 -I../../../../../../include/extensions -I../../../../../../extras/Mesa/src               -I../../../../../../lib/GL/mesa/src/drv/common           -I../../../../../../lib/GL/mesa/src/drv/tdfx -I../../../../../../lib/GL/dri             -I../../../../../../lib/GL/glx          -I../../../../../../exports/include             -I../../../../../../exports/include/GL          -I../../../../../../programs/Xserver/GL/dri             -I../../../../../../programs/Xserver/hw/xfree86/os-support     -I../../../../../../programs/Xserver/hw/xfree86/drivers/tdfx             -I../../../../../../programs/Xserver/hw/xfree86/common          -I../../../../../../lib/GL/dri/drm              -I../../../../../../lib/GL/include  -I../../../../../.. -I../../../../../../exports/include    -Dlinux -D__x86_64__ -D_POSIX_C_SOURCE=199309L                           -D_POSIX_SOURCE -D_XOPEN_SOURCE                -D_BSD_SOURCE -D_SVID_SOURCE                              -D_GNU_SOURCE           -DFUNCPROTO=15 -DNARROWPROTO -DXTHREADS  -D_REENTRANT -DXUSE_MTSAFE_API    -DMALLOC_0_RETURNS_NULL -DGLXEXT -DXF86DRI -DGLX_DIRECT_RENDERING -DGLX_USE_DLOPEN -DGLX_USE_MESA -D__GLX_ALIGN64 -DX_BYTE_ORDER=X_LITTLE_ENDIAN      -fPIC tdfx_span.c
tdfx_span.c: In function 'tdfxDDWriteDepthPixels':
tdfx_span.c:976: error: invalid lvalue in assignment
tdfx_span.c:1008: error: invalid lvalue in assignment
tdfx_span.c: In function 'write_stencil_pixels':
tdfx_span.c:1242: error: invalid lvalue in assignment
make[7]: *** [tdfx_span.o] Error 1
make[7]: Leaving directory `/tmp/buildd/xfree86-4.3.0.dfsg.1/build-tree/xc/lib/GL/mesa/src/drv/tdfx'
make[6]: *** [all] Error 2
make[6]: Leaving directory `/tmp/buildd/xfree86-4.3.0.dfsg.1/build-tree/xc/lib/GL/mesa/src/drv'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/tmp/buildd/xfree86-4.3.0.dfsg.1/build-tree/xc/lib/GL'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/tmp/buildd/xfree86-4.3.0.dfsg.1/build-tree/xc/lib'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/tmp/buildd/xfree86-4.3.0.dfsg.1/build-tree/xc'
make[2]: *** [World] Error 2
make[2]: Leaving directory `/tmp/buildd/xfree86-4.3.0.dfsg.1/build-tree/xc'
make[1]: *** [World] Error 2
make[1]: Leaving directory `/tmp/buildd/xfree86-4.3.0.dfsg.1/build-tree/xc'
make: *** [stampdir/build] Error 2

I've attached a patch which makes xfree86 build with gcc-4.0.

-- System Information:
Debian Release: testing/unstable
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-9-amd64-k8
Locale: LANG=en, LC_CTYPE=en (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)

-- 
Daniel Schepler              "Please don't disillusion me.  I
schepler@math.berkeley.edu    haven't had breakfast yet."
                                 -- Orson Scott Card
diff -urN xfree86-4.3.0.dfsg.1.old/debian/patches/099za_gcc_4.0_compilation_fix.diff xfree86-4.3.0.dfsg.1/debian/patches/099za_gcc_4.0_compilation_fix.diff
--- xfree86-4.3.0.dfsg.1.old/debian/patches/099za_gcc_4.0_compilation_fix.diff	1970-01-01 00:00:00.000000000 +0000
+++ xfree86-4.3.0.dfsg.1/debian/patches/099za_gcc_4.0_compilation_fix.diff	2005-06-19 03:48:14.000000000 +0000
@@ -0,0 +1,30 @@
+--- xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c~	2005-06-19 03:20:47.000000000 +0000
++++ xc/lib/GL/mesa/src/drv/tdfx/tdfx_span.c	2005-06-19 03:24:00.000000000 +0000
+@@ -588,12 +588,14 @@
+     (((type *)((ReadParamsp)->lfbWrapPtr))                          \
+                  [((y)) * ((ReadParamsp)->LFBStrideInElts)          \
+                    + ((x) - (ReadParamsp)->firstWrappedX)])
+-#define PUT_FB_DATA(ReadParamsp, type, x, y, value)                        \
+-    (GET_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
+ #define PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value)              \
+     (GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
+ #define PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value)                \
+     (GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
++#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \
++    (((x) < (ReadParamsp)->firstWrappedX) \
++        ? PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value) \
++        : PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value))
+ 
+ static void
+ tdfxDDWriteDepthSpan(GLcontext * ctx,
+--- xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h~	2005-06-19 03:37:30.000000000 +0000
++++ xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h	2005-06-19 03:37:50.000000000 +0000
+@@ -75,7 +75,7 @@
+     unsigned long       num;
+     char *              str;
+     double              realnum;
+-    Bool		bool;
++    Bool		boolval;
+     OptFrequency	freq;
+ } ValueUnion;
+ 

Reply to: