I'm new to openOCD and just tried to make the latest version from Git.  My
openOCD target is bare-metal ARM. The end of the log is as follows:

/bin/sh ../../libtool --tag=CC   --mode=compile gcc -std=gnu99
> -DHAVE_CONFIG_H -I. -I../..  -I../../src -I../../src
> -DPKGDATADIR=\"/usr/local/share/openocd\" -I../../jimtcl -I../../jimtcl   -g
> -O2 -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra
> -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls
> -Werror -MT breakpoints.lo -MD -MP -MF .deps/breakpoints.Tpo -c -o
> breakpoints.lo breakpoints.c
> libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src
> -I../../src -DPKGDATADIR=\"/usr/local/share/openocd\" -I../../jimtcl
> -I../../jimtcl -g -O2 -Wall -Wstrict-prototypes -Wformat-security -Wshadow
> -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align
> -Wredundant-decls -Werror -MT breakpoints.lo -MD -MP -MF
> .deps/breakpoints.Tpo -c breakpoints.c -o breakpoints.o
> breakpoints.c: In function 'breakpoint_remove_internal':
> breakpoints.c:162:22: error: variable 'breakpoint_p' set but not used
> [-Werror=unused-but-set-variable]
> breakpoints.c: In function 'watchpoint_remove':
> breakpoints.c:335:23: error: variable 'watchpoint_p' set but not used
> [-Werror=unused-but-set-variable]
> cc1: all warnings being treated as errors


After investigating the source file,  here are the two offending sections:

void breakpoint_remove_internal(struct target *target, uint32_t address)
{
struct breakpoint *breakpoint = target->breakpoints;
struct breakpoint **breakpoint_p = &target->breakpoints; (line 162)
while (breakpoint)
{
if (breakpoint->address == address)
break;
breakpoint_p = &breakpoint->next;
breakpoint = breakpoint->next;
}
if (breakpoint)
{
breakpoint_free(target, breakpoint);
}
else
{
LOG_ERROR("no breakpoint at address 0x%8.8" PRIx32 " found", address);
}
}
void watchpoint_remove(struct target *target, uint32_t address)
{
struct watchpoint *watchpoint = target->watchpoints;
struct watchpoint **watchpoint_p = &target->watchpoints; (line 335)
while (watchpoint)
{
if (watchpoint->address == address)
break;
watchpoint_p = &watchpoint->next;
watchpoint = watchpoint->next;
}
if (watchpoint)
{
watchpoint_free(target, watchpoint);
}
else
{
LOG_ERROR("no watchpoint at address 0x%8.8" PRIx32 " found", address);
}
}

I don't understand the error, since it looks like struct watchpoint **
watchpoint_p is being used in the while loop. How can I resolve this?

Best regards,
Andrew Ashworth
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to