Wine: Use the compiler option -Wpointer-arith if available.

Gerald Pfeifer gerald at pfeifer.com
Sat Apr 16 18:19:42 CDT 2011


GCC provides an option -Wpointer-arith and describes it as follows:

   Warn about anything that depends on the "size of" a function type
   or of `void'.  GNU C assigns these types a size of 1, for
   convenience in calculations with `void *' pointers and pointers to
   functions.

This does not trigger on my Wine builds, but then we should not invoke 
sizeof(void) or sizeof(some_function). ;-)  It should help catch any 
such bad future uses of sizeof.

Gerald
---
 configure.ac |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6047744..0ae6625 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1715,6 +1715,7 @@ then
   WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
   WINE_TRY_CFLAGS([-fno-strict-aliasing])
   WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
+  WINE_TRY_CFLAGS([-Wpointer-arith])
   WINE_TRY_CFLAGS([-Wstrict-prototypes])
   WINE_TRY_CFLAGS([-Wtype-limits])
   WINE_TRY_CFLAGS([-Wunused-but-set-parameter])
-- 
1.7.4.1



More information about the wine-patches mailing list