Menu

#104 jtagspi.c on compiling

0.9.0
closed
nobody
None
Normal
Error
2017-01-11
2015-08-15
PEdro
No

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

Discussion

  • Ben Clouser

    Ben Clouser - 2015-08-15

    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

     
  • Ben Clouser

    Ben Clouser - 2015-08-15

    It is a very easy fix. Just set int retval = ERROR_OK; on line 275.

     
  • PEdro

    PEdro - 2015-08-15

    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 :

     
  • Spencer Oliver

    Spencer Oliver - 2017-01-11
    • status: new --> closed
     
  • Spencer Oliver

    Spencer Oliver - 2017-01-11

    change merged.

     

Log in to post a comment.

MongoDB Logo MongoDB