Index: C:/cygwin/home/soliver/openocd/openocd/configure.in
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/configure.in	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/configure.in	(revision 893)
@@ -27,12 +27,10 @@
 is_mingw=no
 is_win32=no
 
-
 AC_ARG_ENABLE(gccwarnings,
-	AS_HELP_STRING([--enable-gccwarnings], [Enable compiler warnings, default yes]),
-	[gcc_warnings=$enablevalue], [gcc_warnings=yes])
+	AS_HELP_STRING([--enable-gccwarnings], [Enable compiler warnings, default no]),
+	[gcc_warnings=$enableval], [gcc_warnings=no])
 
-
 AC_ARG_ENABLE(parport,
   AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]), 
   [build_parport=$enableval], [build_parport=no])
@@ -297,24 +295,27 @@
 AC_PROG_CC
 AC_PROG_RANLIB
 
+# set default gcc warnings
+GCC_WARNINGS="-Wall -Wstrict-prototypes"
+
+# overide default gcc cflags
+if test $gcc_warnings = yes; then
+	CFLAGS="$CFLAGS $GCC_WARNINGS"
+fi
+
 # Setup for compiling build tools
 AC_MSG_CHECKING([for a C compiler for build tools])
 if test $cross_compiling = yes; then
 	AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
-	CFLAGS_FOR_BUILD="-g -O2"
+	CFLAGS_FOR_BUILD="-g -O2 $GCC_WARNINGS"
 else
 	CC_FOR_BUILD=$CC
-	CFLAGS_FOR_BUILD="$CFLAGS $GCC_WARNINGS"
+	CFLAGS_FOR_BUILD=$CFLAGS
 fi
 
-if test $gcc_warnings = yes; then
-   CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -Wall -Wmissing-prototypes -Wstrict-prototypes"
-fi
-
 AC_MSG_RESULT([$CC_FOR_BUILD])
 AC_SUBST(CC_FOR_BUILD)
 AC_SUBST(CFLAGS_FOR_BUILD)
-AC_MSG_NOTICE([CFLAGS_FOR_BUILD = $CFLAGS_FOR_BUILD])
 
 AC_MSG_CHECKING([for suffix of executable build tools])
 if test $cross_compiling = yes; then
Index: C:/cygwin/home/soliver/openocd/openocd/src/helper/jim.c
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/helper/jim.c	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/helper/jim.c	(revision 893)
@@ -7760,7 +7760,7 @@
     return GetProcAddress((HMODULE)handle, symbol);
 }
 static char win32_dlerror_string[121];
-const char *dlerror()
+const char *dlerror(void)
 {
     FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
                    LANG_NEUTRAL, win32_dlerror_string, 120, NULL);
Index: C:/cygwin/home/soliver/openocd/openocd/src/jtag/jlink.c
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/jtag/jlink.c	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/jtag/jlink.c	(revision 893)
@@ -95,8 +95,8 @@
 int jlink_get_status(void);
 
 /* J-Link tap buffer functions */
-void jlink_tap_init();
-int jlink_tap_execute();
+void jlink_tap_init(void);
+int jlink_tap_execute(void);
 void jlink_tap_ensure_space(int scans, int bits);
 void jlink_tap_append_step(int tms, int tdi);
 void jlink_tap_append_scan(int length, u8 *buffer, scan_command_t *command);
@@ -568,7 +568,7 @@
 
 static int last_tms;
 
-void jlink_tap_init()
+void jlink_tap_init(void)
 {
 	tap_length = 0;
 	pending_scan_results_length = 0;
@@ -640,7 +640,7 @@
 
 /* Pad and send a tap sequence to the device, and receive the answer.
  * For the purpose of padding we assume that we are in idle or pause state. */
-int jlink_tap_execute()
+int jlink_tap_execute(void)
 {
 	int byte_length;
 	int tms_offset;
Index: C:/cygwin/home/soliver/openocd/openocd/src/jtag/amt_jtagaccel.c
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/jtag/amt_jtagaccel.c	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/jtag/amt_jtagaccel.c	(revision 893)
@@ -402,7 +402,7 @@
 }
 
 #if PARPORT_USE_GIVEIO == 1
-int amt_jtagaccel_get_giveio_access()
+int amt_jtagaccel_get_giveio_access(void)
 {
     HANDLE h;
     OSVERSIONINFO version;
Index: C:/cygwin/home/soliver/openocd/openocd/src/jtag/jtag.c
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/jtag/jtag.c	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/jtag/jtag.c	(revision 893)
@@ -1316,7 +1316,7 @@
 
 /* Try to examine chain layout according to IEEE 1149.1 §12
  */
-int jtag_examine_chain()
+int jtag_examine_chain(void)
 {
 	jtag_device_t *device = jtag_devices;
 	scan_field_t field;
Index: C:/cygwin/home/soliver/openocd/openocd/src/jtag/parport.c
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/jtag/parport.c	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/jtag/parport.c	(revision 893)
@@ -274,7 +274,7 @@
 }
 
 #if PARPORT_USE_GIVEIO == 1
-int parport_get_giveio_access()
+int parport_get_giveio_access(void)
 {
 	HANDLE h;
 	OSVERSIONINFO version;
Index: C:/cygwin/home/soliver/openocd/openocd/src/target/target.c
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/target/target.c	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/target/target.c	(revision 893)
@@ -383,7 +383,7 @@
  *
  * XScale
  */
-int target_examine(struct command_context_s *cmd_ctx)
+int target_examine(void)
 {
 	int retval = ERROR_OK;
 	target_t *target = targets;
Index: C:/cygwin/home/soliver/openocd/openocd/src/target/target.h
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/target/target.h	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/target/target.h	(revision 893)
@@ -250,7 +250,7 @@
 extern int target_register_commands(struct command_context_s *cmd_ctx);
 extern int target_register_user_commands(struct command_context_s *cmd_ctx);
 extern int target_init(struct command_context_s *cmd_ctx);
-extern int target_examine();
+extern int target_examine(void);
 extern int handle_target(void *priv);
 extern int target_process_reset(struct command_context_s *cmd_ctx, enum target_reset_mode reset_mode);
 
Index: C:/cygwin/home/soliver/openocd/openocd/src/target/mips_m4k.c
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/target/mips_m4k.c	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/target/mips_m4k.c	(revision 893)
@@ -43,10 +43,10 @@
 int mips_m4k_write_memory(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer);
 int mips_m4k_register_commands(struct command_context_s *cmd_ctx);
 int mips_m4k_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
-int mips_m4k_quit();
+int mips_m4k_quit(void);
 int mips_m4k_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target);
 
-int mips_m4k_examine(struct command_context_s *cmd_ctx, struct target_s *target);
+int mips_m4k_examine(struct target_s *target);
 int mips_m4k_assert_reset(target_t *target);
 int mips_m4k_deassert_reset(target_t *target);
 
@@ -618,7 +618,7 @@
 	return ERROR_OK;
 }
 
-int mips_m4k_examine(struct command_context_s *cmd_ctx, struct target_s *target)
+int mips_m4k_examine(struct target_s *target)
 {
 	int retval;
 	mips32_common_t *mips32 = target->arch_info;
Index: C:/cygwin/home/soliver/openocd/openocd/src/openocd.c
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/src/openocd.c	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/src/openocd.c	(revision 893)
@@ -118,7 +118,7 @@
 	if (jtag_init(cmd_ctx) == ERROR_OK)
 	{
 		LOG_DEBUG("jtag init complete");
-		if (target_examine(cmd_ctx) == ERROR_OK)
+		if (target_examine() == ERROR_OK)
 		{
 			LOG_DEBUG("jtag examine complete");
 		}
Index: C:/cygwin/home/soliver/openocd/openocd/doc/openocd.texi
===================================================================
--- C:/cygwin/home/soliver/openocd/openocd/doc/openocd.texi	(revision 892)
+++ C:/cygwin/home/soliver/openocd/openocd/doc/openocd.texi	(revision 893)
@@ -193,6 +193,13 @@
 Linux users should copy the various parts of the D2XX package to the appropriate
 locations, i.e. /usr/include, /usr/lib. 
 
+Miscellaneous configure options
+
+@itemize @bullet
+@item
+@option{--enable-gccwarnings} - enable extra gcc warnings during build
+@end itemize
+
 @node Running
 @chapter Running
 @cindex running OpenOCD


