- fix target_examine declaration
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 6 Aug 2008 14:36:37 +0000 (14:36 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 6 Aug 2008 14:36:37 +0000 (14:36 +0000)
- remove build warnings
- added --enable-gccwarnings to docs
- update mips_m4k_examine function

git-svn-id: svn://svn.berlios.de/openocd/trunk@893 b42882b7-edfa-0310-969c-e2dbd0fdcd60

configure.in
doc/openocd.texi
src/helper/jim.c
src/jtag/amt_jtagaccel.c
src/jtag/jlink.c
src/jtag/jtag.c
src/jtag/parport.c
src/openocd.c
src/target/mips_m4k.c
src/target/target.c
src/target/target.h

index 2c2f3cde1c00c60af5dce7b97c0b4944fa92da1b..007ac14237e462ac2ce49d3097f0b64ef8d988e6 100644 (file)
@@ -27,11 +27,9 @@ is_cygwin=no
 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]), 
@@ -297,24 +295,27 @@ AC_LANG_C
 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"
-fi
-
-if test $gcc_warnings = yes; then
-   CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -Wall -Wmissing-prototypes -Wstrict-prototypes"
+       CFLAGS_FOR_BUILD=$CFLAGS
 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 de996eb9b937909a2a59d20ec7a511c4f5ddefbf..ef921536ed9ed89c8a5998a6ab79eb962c3ac4dc 100644 (file)
@@ -193,6 +193,13 @@ absolute path containing no spaces.
 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
index 847b855e98aa4f3770c6ab0b3d746cf7c7905ff2..1a35b32b053422ff0091322b915e24496c09e3ea 100644 (file)
@@ -7760,7 +7760,7 @@ void *dlsym(void *handle, const char *symbol)
     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 d29d092f87cd31e71379aca8338760f9cf1f9ae3..163cd0afe920bec05b22c3959c118114b9b7f2fb 100644 (file)
@@ -402,7 +402,7 @@ int amt_jtagaccel_execute_queue(void)
 }
 
 #if PARPORT_USE_GIVEIO == 1
-int amt_jtagaccel_get_giveio_access()
+int amt_jtagaccel_get_giveio_access(void)
 {
     HANDLE h;
     OSVERSIONINFO version;
index f6da6199b53c5ab24542286558594d574a56b2f0..b20efcabf04bf2115bf1de58c561164cf468c0ef 100644 (file)
@@ -95,8 +95,8 @@ void jlink_simple_command(u8 command);
 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 pending_scan_result_t pending_scan_results_buffer[MAX_PENDING_SCAN_RESULT
 
 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 @@ void jlink_tap_append_scan(int length, u8 *buffer, scan_command_t *command)
 
 /* 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 d34cec5a257b3187221eadb7b9870408ff3f2d87..164de0c0d8a575d119830b7ab3a97b6a8f0acc51 100644 (file)
@@ -1316,7 +1316,7 @@ void jtag_sleep(u32 us)
 
 /* 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 e993497421623dbf33e738cba726a98eb2e88b42..19a200bf4aec547e7aca4ca9e82fec6fa80669f5 100644 (file)
@@ -274,7 +274,7 @@ int parport_register_commands(struct command_context_s *cmd_ctx)
 }
 
 #if PARPORT_USE_GIVEIO == 1
-int parport_get_giveio_access()
+int parport_get_giveio_access(void)
 {
        HANDLE h;
        OSVERSIONINFO version;
index 67d890ecd0d883b2a6d594e09de5667285bae28e..9abe3b3562166dee2ed45799b2d7d35a39143832 100644 (file)
@@ -118,7 +118,7 @@ int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **arg
        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 4cefbf9244e51c8f823ea349f417ba93339588cf..7cca55de61f375cb602ff1d2f6b5c1f761a78356 100644 (file)
@@ -43,10 +43,10 @@ int mips_m4k_read_memory(struct target_s *target, u32 address, u32 size, u32 cou
 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 @@ int mips_m4k_target_command(struct command_context_s *cmd_ctx, char *cmd, char *
        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 37e1b3695a10d72df52a1283bdd963ebca0aeefa..efa00edf8cdbfb7f754bd853813017dd4827f810 100644 (file)
@@ -383,7 +383,7 @@ static int default_examine(struct target_s *target)
  *
  * XScale
  */
-int target_examine(struct command_context_s *cmd_ctx)
+int target_examine(void)
 {
        int retval = ERROR_OK;
        target_t *target = targets;
index 2551ede7ba07cfaeb896d070495cd8d397a63fcf..bf009ea430e1664a6e1eff054004702ad233e3da 100644 (file)
@@ -250,7 +250,7 @@ typedef struct target_timer_callback_s
 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);