I've been trying to rebuild the binary on Fedora 21 x86_64 and I'm getting a mess. Below is the output of make:
cc -O3 -g -Wall -Werror -lftdi ftdi-probe.c -o ftdi-probe
ftdi-probe.c: In function ‘probe_usb’:
ftdi-probe.c:41:30: error: storage size of ‘eedata’ isn’t known
struct ftdi_eeprom eedata;
^
ftdi-probe.c:69:9: error: implicit declaration of function ‘ftdi_read_eeprom_getsize’ [-Werror=implicit-function-declaration]
size = ftdi_read_eeprom_getsize(fc, eeprom, 128);
^
ftdi-probe.c:94:38: error: passing argument 2 of ‘ftdi_eeprom_decode’ makes integer from pointer without a cast [-Werror]
ftdi_eeprom_decode( &eedata, eeprom, size );
^
In file included from ftdi-probe.c:21:0:
/usr/include/libftdi1/ftdi.h:539:9: note: expected ‘int’ but argument is of type ‘unsigned char *’
int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose);
^
ftdi-probe.c:94:9: error: too many arguments to function ‘ftdi_eeprom_decode’
ftdi_eeprom_decode( &eedata, eeprom, size );
^
In file included from ftdi-probe.c:21:0:
/usr/include/libftdi1/ftdi.h:539:9: note: declared here
int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose);
^
ftdi-probe.c:41:30: error: unused variable ‘eedata’ [-Werror=unused-variable]
struct ftdi_eeprom eedata;
^
ftdi-probe.c: In function ‘main’:
ftdi-probe.c:116:5: error: implicit declaration of function ‘exit’ [-Werror=implicit-function-declaration]
exit(0);
^
ftdi-probe.c:116:5: error: incompatible implicit declaration of built-in function ‘exit’ [-Werror]
cc1: all warnings being treated as errors
<builtin>: recipe for target 'ftdi-probe' failed
make: *** [ftdi-probe] Error 1
Looking at the version of ftdi.h from the Fedora package for libftdi-devel, it looks like struct ftdi_eeprom is not defined. While this is clearly an issue for the libftdi guys, does anyone have a header file with the struct defined?
Also, it looks like the call to ftdi_eeprom_decode has too many parameters. The call in
ftdi_probe.com is: ftdi_eeprom_decode( &eedata, eeprom, size ); [note: that's the ftdi_eeprom structure, an unsigned char, and an int]
But the function is defined in ftdi.h as: int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose);
Any thoughts?