SpinalHDL / openocd_riscv

Spen's Official OpenOCD Mirror
Other
47 stars 34 forks source link

Compile warnings (deprecation) #17

Closed piegamesde closed 3 years ago

piegamesde commented 3 years ago
src/jtag/drivers/presto.c: In function 'presto_open_libftdi':
src/jtag/drivers/presto.c:163:2: error: 'ftdi_usb_purge_buffers' is deprecated [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
  163 |  if (ftdi_usb_purge_buffers(&presto->ftdic) < 0) {
      |  ^~
In file included from src/jtag/drivers/presto.c:37:
/nix/store/aphdnma272mh19lh7pgzlaivrfgj5hga-libftdi-1.5/include/libftdi1/ftdi.h:566:20: note: declared here
  566 |     int DEPRECATED(ftdi_usb_purge_buffers(struct ftdi_context *ftdi));
      |                    ^~~~~~~~~~~~~~~~~~~~~~
/nix/store/aphdnma272mh19lh7pgzlaivrfgj5hga-libftdi-1.5/include/libftdi1/ftdi.h:247:55: note: in definition of macro 'DEPRECATED'
  247 | #define DEPRECATED(func) __attribute__ ((deprecated)) func
      |                                                       ^~~~

and

src/jtag/drivers/presto.c:177:3: error: 'ftdi_usb_purge_buffers' is deprecated [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
  177 |   if (ftdi_usb_purge_buffers(&presto->ftdic) < 0)
      |   ^~
In file included from src/jtag/drivers/presto.c:37:
/nix/store/aphdnma272mh19lh7pgzlaivrfgj5hga-libftdi-1.5/include/libftdi1/ftdi.h:566:20: note: declared here
  566 |     int DEPRECATED(ftdi_usb_purge_buffers(struct ftdi_context *ftdi));
      |                    ^~~~~~~~~~~~~~~~~~~~~~
/nix/store/aphdnma272mh19lh7pgzlaivrfgj5hga-libftdi-1.5/include/libftdi1/ftdi.h:247:55: note: in definition of macro 'DEPRECATED'
  247 | #define DEPRECATED(func) __attribute__ ((deprecated)) func
      |                                                       ^~~~
GuzTech commented 3 years ago

You can work around it by running:

CFLAGS="-g -O2 -Wno-deprecated -Wno-error" ./configure --enable-ftdi --enable-dummy

and then compiling it by running make

piegamesde commented 3 years ago

I took the easy route and nuked with CFLAGS='-w', but a proper fix would be appreciated. Those warnings probably aren't there for no reason.

Dolu1990 commented 3 years ago

Sorry, i forgot about the issue.

So, i would say, the only fix we should implement would be to merge upstream openocd. I just did it right now in the upstream_merge branch :)

Let's me know how things goes

piegamesde commented 3 years ago

The branch works fine, thank you

Dolu1990 commented 3 years ago

Thanks ^^

Merged in the default branch.