On Tue, Oct 27, 2020 at 10:38:10PM -0000, Antonio Borneo wrote:
> At a first check, seams enough replacing ftdi_usb_purge_buffers() with
> ftdi_tcioflush().
> The prototype of the functions is exactly the same, so simply run
> sed -i s/ftdi_usb_purge_buffers/ftdi_usb_purge_buffers/ 
> src/jtag/drivers/{openjtag.c,presto.c}

I guess you meant

sed -i s/ftdi_usb_purge_buffers/ftdi_tcioflush/ 
src/jtag/drivers/{openjtag.c,presto.c}

> The difficoult part now is to make 'configure' able to detect the current
> version of libftdi1 and force using one of the two API.

Probably change the .c code to use ftdi_tcioflush and add an
appropriate macro to replace it with the old function name when
pkg-config reports an older libftdi is used.


---

** [tickets:#286] Deprecated warnings with libftdi 1.5**

**Status:** new
**Milestone:** 0.10.0
**Created:** Tue Oct 27, 2020 04:12 PM UTC by MrLavender
**Last Updated:** Tue Oct 27, 2020 11:01 PM UTC
**Owner:** nobody


The build fails with libftdi 1.5 because of deprecated warnings and -Werror. 
I'm sorry I don't have time to investigate further, I just worked around it 
using `CFLAGS="-g -O2 -Wno-deprecated"` with `configure`.

```
src/jtag/drivers/presto.c:163:6: error: 'ftdi_usb_purge_buffers' is deprecated
      [-Werror,-Wdeprecated-declarations]
        if (ftdi_usb_purge_buffers(&presto->ftdic) < 0) {
            ^
/usr/local/Cellar/libftdi/1.5/include/libftdi1/ftdi.h:566:9: note:
      'ftdi_usb_purge_buffers' has been explicitly marked deprecated here
    int DEPRECATED(ftdi_usb_purge_buffers(struct ftdi_context *ftdi));
        ^
/usr/local/Cellar/libftdi/1.5/include/libftdi1/ftdi.h:247:42: note: expanded
      from macro 'DEPRECATED'
#define DEPRECATED(func) __attribute__ ((deprecated)) func
                                         ^
src/jtag/drivers/presto.c:177:7: error: 'ftdi_usb_purge_buffers' is deprecated
      [-Werror,-Wdeprecated-declarations]
                if (ftdi_usb_purge_buffers(&presto->ftdic) < 0)
                    ^
/usr/local/Cellar/libftdi/1.5/include/libftdi1/ftdi.h:566:9: note:
      'ftdi_usb_purge_buffers' has been explicitly marked deprecated here
    int DEPRECATED(ftdi_usb_purge_buffers(struct ftdi_context *ftdi));
        ^
/usr/local/Cellar/libftdi/1.5/include/libftdi1/ftdi.h:247:42: note: expanded
      from macro 'DEPRECATED'
#define DEPRECATED(func) __attribute__ ((deprecated)) func
                                         ^
2 errors generated.
```



---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to