]> git.sur5r.net Git - openocd/commitdiff
rtos: fix uninitialised variable warning
authorPaul Fertser <fercerpav@gmail.com>
Fri, 17 Jan 2014 10:08:07 +0000 (14:08 +0400)
committerSpencer Oliver <spen@spen-soft.co.uk>
Tue, 4 Feb 2014 21:17:24 +0000 (21:17 +0000)
Breaks build with clang 3.3. This "addr" variable is actually always
ignored by next_symbol() when cur_symbol is an empty string but clang
can't (and probably shouldn't) prove that automatically.

Change-Id: Id030f1aa34b9d40b5fa20a422031511520e52669
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1876
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/rtos/rtos.c

index 11cb79263790058853833429ae51213f50a3a8de..cdd37608ed446156ca409fd61405b8427b170ab3 100644 (file)
@@ -189,7 +189,7 @@ static char *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr)
 int rtos_qsymbol(struct connection *connection, char *packet, int packet_size)
 {
        int rtos_detected = 0;
-       uint64_t addr;
+       uint64_t addr = 0;
        size_t reply_len;
        char reply[GDB_BUFFER_SIZE], cur_sym[GDB_BUFFER_SIZE / 2] = "", *next_sym;
        struct target *target = get_target_from_connection(connection);