I have been looking over the net to solve this error without success .
on the configuration everything is good by using :
./configure --enable-ftdi
Then when i start the compilation i get this error that i can get out :
libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../.. -I../../../src -I../../../src -I../../../src/helper -DPKGDATADIR=\"/usr/local/share/openocd\" -DBINDIR=\"/usr/local/bin\" -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 jtagspi.lo -MD -MP -MF .deps/jtagspi.Tpo -c jtagspi.c -o jtagspi.o
jtagspi.c: In function 'jtagspi_erase':
jtagspi.c:275:6: error: 'retval' may be used uninitialized in this function [-Werror=maybe-uninitialized]
cc1: all warnings being treated as errors
make[5]: *** [jtagspi.lo] Error 1
make[5]: Leaving directory /opt/openocd-code/src/flash/nor'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory/opt/openocd-code/src/flash'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory /opt/openocd-code/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory/opt/openocd-code/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/openocd-code'
make: *** [all] Error 2
I am having the exact same issue.
gcc --version:
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
uname -a:
3.13.0-49-generic #81~precise1-Ubuntu SMP Wed Mar 25 16:32:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Regards
It is a very easy fix. Just set int retval = ERROR_OK; on line 275.
thanks it worked .
For those who have little experince do this :
Go to the directory of openocd
then write :
leafpad src/flash/nor/jtagspi.c
and change it like it is ine picture :
)
change merged.