Re: Bug#288748: zgv: FTBFS with gcc-4.0: invalid lvalue in assignment
reassign 288748 libc6-dev
thanks
As the memset line in question, although ugly, is valid ANSI C,
I suspect this is a bug in the definition of the macro memset.
After protecting the arguments to the macro __memset_1 in
/usr/include/bits/string2.h, it compiled fine.
--- string2.h.orig 2005-01-05 20:34:29.000000000 +0100
+++ /usr/include/bits/string2.h 2005-01-05 20:34:33.000000000 +0100
@@ -106,7 +106,7 @@
: memset (s, c, n))))
# define __memset_1(s, c) ({ void *__s = (s); \
- *((__uint8_t *) __s) = (__uint8_t) c; __s; })
+ *((__uint8_t *) __s) = (__uint8_t) (c); __s; })
# define __memset_gc(s, c, n) \
({ void *__s = (s); \
On Wed, Jan 05, 2005 at 02:55:14PM +0100, Andreas Jochens wrote:
> Package: zgv
> Severity: normal
> Tags: patch
>
> When building 'zgv' with gcc-4.0,
> I get the following error:
>
> gcc -O2 -Wall -fomit-frame-pointer -finline-functions -DBACKEND_SVGALIB -DRGB_DB_FILE=\"/usr/X11R6/lib/X11/rgb.txt\" -c -o font.o font.c
> font.c: In function 'vgadrawtext_bmp':
> font.c:502: error: invalid lvalue in assignment
> make[2]: *** [font.o] Error 1
> make[2]: Leaving directory `/zgv-5.7/src'
>
> With the attached patch 'zgv' can be compiled with gcc-4.0.
>
> Regards
> Andreas Jochens
>
> diff -urN ../tmp-orig/zgv-5.7/src/font.c ./src/font.c
> --- ../tmp-orig/zgv-5.7/src/font.c 2003-04-05 19:41:51.000000000 +0200
> +++ ./src/font.c 2005-01-05 14:01:21.974692720 +0100
> @@ -498,9 +498,10 @@
> if(vga_getcolors()>256 || squish_x)
> dont_use_lines=1;
>
> -if(current_colour!=old_colour && !dont_use_lines)
> - memset(scanbit,old_colour=current_colour,sizeof(scanbit));
> -
> +if(current_colour!=old_colour && !dont_use_lines) {
> + memset(scanbit,current_colour,sizeof(scanbit));
> + old_colour=current_colour;
> +}
> /* pick font to match siz. */
> switch(siz)
> {
--
Christian
Reply to: