[libvoikko] [PATCH] libvoikko: Fix build with GCC 4.6

Ville-Pekka Vainio vpivaini at cs.helsinki.fi
Tue Feb 15 17:09:07 EET 2011


I my mail software doesn't break the patch... Fedora recently switched
to GCC 4.6 in Fedora 15 and building libvoikko 3.1 with it causes this
warning, which is treated as an error:

morphology/malaga/values.cpp: In function 'void
libvoikko::morphology::malaga::build_path(libvoikko::morphology::malaga::int_t, libvoikko::morphology::malaga::MalagaState*)':
morphology/malaga/values.cpp:1219:24: error: variable 'element_end' set
but not used [-Werror=unused-but-set-variable]

The following patch fixes the problem.

 - Ville-Pekka Vainio

diff -ur libvoikko-3.1.orig/src/morphology/malaga/values.cpp libvoikko-3.1/src/morphology/malaga/values.cpp
--- libvoikko-3.1.orig/src/morphology/malaga/values.cpp	2010-11-14 11:10:16.000000000 +0200
+++ libvoikko-3.1/src/morphology/malaga/values.cpp	2011-02-15 16:44:03.695451550 +0200
@@ -1216,7 +1216,7 @@
  * symbols. If a value is a list, the elements of this list are inserted into
  * NEW_LIST instead of the value itself. */
 {
-  value_t new_list, v, element_end;
+  value_t new_list, v;
   int_t i, new_list_length;
   value_t *elements;
 
@@ -1227,7 +1227,6 @@
     switch (TYPE( elements[i] )) 
     {
     case LIST_TYPE:
-      element_end = NEXT_VALUE( elements[i] );
       new_list_length += length_of_value( elements[i] ) - 2;
       break;
     case SYMBOL_TYPE:





More information about the Libvoikko mailing list