From pere@minerva.cc.uit.no Sun Oct 25 20:26:55 1998
Received: from minerva.cc.uit.no (pere@nb38.stud.cs.UiT.No [129.242.13.48])
	by yuubin.games.no (8.8.7/8.8.7) with ESMTP id VAA24459
	for <pere@games.no>; Sun, 25 Oct 1998 21:26:54 +0100
Received: (from pere@localhost)
	by minerva.cc.uit.no (8.8.7/8.8.7) id VAA26463;
	Sun, 25 Oct 1998 21:26:59 +0100
Date: Sun, 25 Oct 1998 21:26:59 +0100
Message-Id: <199810252026.VAA26463@minerva.cc.uit.no>
From: Petter Reinholdtsen <pere@localhost.localdomain>
To: patches@winehq.com
Subject: Patch for more warnings when compiling wine
Status: RO


Here is a patch to get more warnings when compiling Wine.  There are
lots of bugs which would be discovered with more warnings, so I
beleave these new warnings should be default.

ChangeLog entry:

  * configure.in acinclude.m4: Petter Reinholdtsen <pere@td.org.uit.no>
  Add '-Wstrict-prototypes -Wcomments -pedantic' and '-ansi' when
  --enable-ansi is used, to CFLAGS when using GCC.  The code currently
  fails to compile when -ansi is used.

Index: configure.in
===================================================================
RCS file: /home/wine/wine/configure.in,v
retrieving revision 1.4
diff -u -r1.4 configure.in
--- configure.in	1998/10/11 17:09:05	1.4
+++ configure.in	1998/10/25 20:23:45
@@ -23,6 +23,9 @@
 [  --disable-emulator      build only the Wine library, not the emulator],
 [if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
 
+AC_ARG_ENABLE(ansi,
+[  --enable-ansi           warn on non ANSI C code], )
+
 AC_ARG_ENABLE(dll,
 [  --enable-dll            build the Wine library as a DLL],
 [if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
@@ -127,11 +130,33 @@
 dnl **** If ln -s doesn't work, use cp instead ****
 if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
 
-dnl **** Check for gcc strength-reduce bug ****
-
 if test "x${GCC}" = "xyes"
 then
-  CFLAGS="$CFLAGS -Wall"
+
+  # We want warnings, lots of warnings :-)
+  WINE_GREP_CFLAGS(-Wall, [
+    CFLAGS="$CFLAGS -Wall"
+  ])
+  WINE_GREP_CFLAGS(-Wstrict-prototypes, [
+    CFLAGS="$CFLAGS -Wstrict-prototypes"
+  ])
+
+  WINE_GREP_CFLAGS(-Wcomments, [
+    CFLAGS="$CFLAGS -Wcomments"
+  ])
+
+  WINE_GREP_CFLAGS(-pedantic, [
+    CFLAGS="$CFLAGS -pedantic"
+  ])
+
+  if eval "test x$enable_ansi = xyes"; then
+    WINE_GREP_CFLAGS(-ansi, [
+      CFLAGS="$CFLAGS -ansi"
+    ])
+  fi
+
+dnl **** Check for gcc strength-reduce bug ****
+
   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
                   AC_TRY_RUN([
 int main(void) {

============================ acinclude.m4 ================================
dnl
dnl Run 'aclocal; autoconf' to get this this include in configure
dnl

dnl WINE_GREP_CFLAGS(flag, cmd_if_missing, cmd_if_present)
AC_DEFUN(WINE_GREP_CFLAGS,
[case "$CFLAGS" in
"$1" | "$1 "* | *" $1" | *" $1 "* )
  ifelse($#, 3, [$3], [:])
  ;;
*)
  $2
  ;;
esac
])          
===========================================================================
-- 
##>  Petter Reinholdtsen  <##  |  pere@td.org.uit.no

