Use GCC's -Wtype-limits

Gerald Pfeifer gerald at pfeifer.com
Fri Nov 16 17:55:14 CST 2007


Many of the real bug fixes I made recently (or triggered others to
make) where found by GCC's -Wtype-limits option that will appear in
GCC 4.3 which already is the default compiler in openSUSE development
trees.

This enables warnings of the kind
  comparison of unsigned expression < 0 is always false
that more often than not indicate real bugs in the code.

If applied, I will commit to address, directly and by engaging others,
the occurrences of such warnings in Wine.

Gerald

ChangeLog:
Use GCC's -Wtype-limits if possible.

Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.725
diff -u -3 -p -r1.725 configure.ac
--- configure.ac	8 Nov 2007 13:09:33 -0000	1.725
+++ configure.ac	16 Nov 2007 23:46:05 -0000
@@ -1134,6 +1134,7 @@ then
   WINE_TRY_CFLAGS([-fno-strict-aliasing])
   WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
   WINE_TRY_CFLAGS([-Wwrite-strings])
+  WINE_TRY_CFLAGS([-Wtype-limits])
 
   dnl Check for noisy string.h
   saved_CFLAGS="$CFLAGS"



More information about the wine-patches mailing list