Re: [g-a-devel] [PATCH] Fix gcc-4.0 invalid lvalue in assignment error in Gnopernicus



On Sun, 2005-01-16 at 01:50, Mario Lang wrote:

Hi,

The problem is in all cases a line like:
  (const gchar*)tmp = str;

A fix like
  tmp = str;
is reported as a warning if -Wall compile flag is used. The cast above was introduced to avoid this waning.  

The correct fix is (in my opinion):
  tmp = (gchar *)str;
because this way no error or warning is reported.

I did all test with gcc version 3.3.3.

Mario, please check and tell me if my suggestion solves the problem for gcc 4.0.

Regards,
Remus

> Hi.
> 
> I've been made aware that currently, gnopernicus does not build with
> gcc-4.0.  The forwarded msg contains a patch which fixes this.  I've tested
> it against latest CVS, and it is still required, so maybe you'd like
> to apply these changes.
> 
> Thanks
> 
> 
> ______________________________________________________________________
> From: Andreas Jochens <aj andaco de>
> To: Debian Bug Tracking System <submit bugs debian org>
> Subject: Bug#286872: gnopernicus: FTBFS (amd64/gcc-4.0): invalid lvalue in assignment
> Date: Wed, 22 Dec 2004 19:53:29 +0100
> 
> Package: gnopernicus
> Severity: normal
> Tags: patch
> 
> When building 'gnopernicus' on amd64 with gcc-4.0,
> I get the following error:
> 
> cmdmapui.c: In function 'cmdui_get_text_from_code':
> cmdmapui.c:343: error: invalid lvalue in assignment
> cmdmapui.c: In function 'cmdui_get_code_from_text':
> cmdmapui.c:393: error: invalid lvalue in assignment
> cmdmapui.c: In function 'cmdui_get_key':
> cmdmapui.c:796: error: invalid lvalue in assignment
> cmdmapui.c: In function 'cmdui_selection_changed':
> cmdmapui.c:1312: warning: cast from pointer to integer of different size
> make[4]: *** [cmdmapui.o] Error 1
> make[4]: Leaving directory `/gnopernicus-0.8.4/gnopi'
> 
> With the attached patch 'gnopernicus' can be compiled
> on amd64 using gcc-4.0.
> 
> Regards
> Andreas Jochens
> 
> diff -urN ../tmp-orig/gnopernicus-0.8.4/gnopi/cmdmapui.c ./gnopi/cmdmapui.c
> --- ../tmp-orig/gnopernicus-0.8.4/gnopi/cmdmapui.c	2004-02-23 16:25:37.000000000 +0100
> +++ ./gnopi/cmdmapui.c	2004-12-22 18:13:55.526153584 +0100
> @@ -340,7 +340,7 @@
>  				str[POS_DIGIT_3]);
>  
>      delimit = g_strrstr (str, KEY_NAME_SEPARATOR);
> -    (const gchar*)tmp = str;
> +    tmp = str;
>      if (delimit)
>  	tmp = delimit + 1;
>  
> @@ -390,7 +390,7 @@
>      }
>      
>      delimit = g_strrstr (str, KEY_SEPARATOR);
> -    (const gchar*)tmp = str;
> +    tmp = str;
>      
>      if (delimit)
>  	tmp = delimit + 1;
> @@ -793,7 +793,7 @@
>      
>      line = alt || shift || ctrl ;
>      
> -    (const gchar*)key = cmdui_get_key_keystring (gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (cb_key_list)->entry)));
> +    key = cmdui_get_key_keystring (gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (cb_key_list)->entry)));
>      
>      if (!key || strlen (key) == 0)
>  	return rv;
> 
> 
> 
> ______________________________________________________________________
> -- 
> CYa,
>   Mario
> 
> ______________________________________________________________________
> _______________________________________________
> Gnome-accessibility-devel mailing list
> Gnome-accessibility-devel gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel




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