Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi,

A build with --enable-debug (or is it --enable-dbgutil?) fails in
graphite... for a problem already corrected in graphite's
configure.ac, but its "configure" is outdated and thus the problem
still surfaces.

The problem is that graphite does not build with -Werror in debug
mode; one of the least fixable reasons is that it uses asserts left
and right, asserts are *designed* to always be true, sometimes gcc
detects that they are (e.g. when comparing an unsigned integer type
with 0), this raises a warning that gets treated as error because of
-Werror.

graphite's configure puts -Werror in CFLAGS when passed
--enable-debug; its configure.ac does not, so all I had to do was to
run autoconf.

Before I got to the point of trying to disable -Werror (and
understanding why it was enabled in the first place), I fixed one of
the warnings. Patch attached, still does not hurt to apply janitorialy
:)

-- 
Lionel
diff -u --recursive silgraphite-2.3.1/engine/src/generic/Util.cpp 
../../graphite/unxlngx6/misc/build/silgraphite-2.3.1/engine/src/generic/Util.cpp
--- silgraphite-2.3.1/engine/src/generic/Util.cpp       2009-01-21 23:36:42.000000000 +0100
+++ ../../graphite/unxlngx6/misc/build/silgraphite-2.3.1/engine/src/generic/Util.cpp    2011-01-14 
23:27:40.000000000 +0100
@@ -191,8 +194,8 @@
                else
                        iuLim = iu;
        }
-       Assert(iuMin == cu || iuMin < cu && u <= g_rguPrimes[iuMin]);
-       Assert(iuMin == 0 || iuMin > 0 && u > g_rguPrimes[iuMin - 1]);
+       Assert(iuMin == cu || (iuMin < cu && u <= g_rguPrimes[iuMin]));
+       Assert(iuMin == 0  || (iuMin > 0  && u >  g_rguPrimes[iuMin - 1]));
 
        if (!iuMin)
                return g_rguPrimes[0];
@@ -222,8 +225,8 @@
                else
                        iuLim = iu;
        }
-       Assert(iuMin == cu || iuMin < cu && u < g_rguPrimes[iuMin]);
-       Assert(iuMin == 0 || iuMin > 0 && u >= g_rguPrimes[iuMin - 1]);
+       Assert(iuMin == cu || (iuMin < cu && u <  g_rguPrimes[iuMin]));
+       Assert(iuMin == 0  || (iuMin > 0  && u >= g_rguPrimes[iuMin - 1]));
 
        if (iuMin == cu)
                return g_rguPrimes[cu - 1];
@@ -249,8 +252,8 @@
                else
                        iuLim = iu;
        }
-       Assert(iuMin == cu || iuMin < cu && u <= g_rguPrimes[iuMin]);
-       Assert(iuMin == 0 || iuMin > 0 && u > g_rguPrimes[iuMin - 1]);
+       Assert(iuMin == cu || (iuMin < cu && u <= g_rguPrimes[iuMin]));
+       Assert(iuMin == 0  || (iuMin > 0  && u >  g_rguPrimes[iuMin - 1]));
 
        if (!iuMin)
                return g_rguPrimes[0];

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.