Source: libxtrx Version: 0.0.1+git20191219.98458ce-1 Severity: important Tags: ftbfs upstream
I am building rdeps of libsoapysdr in preparation of the transition to version 0.8. This version has changed the SoapySDRDevice_setupStream() function signature to return the SoapySDRStream directly rather than through a pointer: * Recommended keys to use in the args dictionary: * - "WIRE" - format of the samples between device and host * \endparblock - * \return 0 for success or error code on failure + * \return the stream pointer or nullptr for failure */ -SOAPY_SDR_API int SoapySDRDevice_setupStream(SoapySDRDevice *device, - SoapySDRStream **stream, +SOAPY_SDR_API SoapySDRStream *SoapySDRDevice_setupStream(SoapySDRDevice *device, const int direction, const char *format, const size_t *channels, This causes a build failure in libxtrx when building against the new libsoapysdr. Upstream appears to have switched to the new call signature in their current code, dropping compatibility with libsoapysdr 0.7 at the same time. A way to be compatible with both would be using preprocessor directives to discriminate between API version using SOAPY_SDR_API_VERSION. Log of the failed build: /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c: In function 'main': /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:70:41: warning: passing argument 2 of 'SoapySDRDevice_setupStream' makes integer from pointer without a cast [-Wint-conversion] 70 | if (SoapySDRDevice_setupStream(sdr, &rxStream, SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL) != 0) | ^~~~~~~~~ | | | SoapySDRStream ** In file included from /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:1: /usr/include/SoapySDR/Device.h:307:15: note: expected 'int' but argument is of type 'SoapySDRStream **' 307 | const int direction, | ~~~~~~~~~~^~~~~~~~~ /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:70:52: warning: passing argument 3 of 'SoapySDRDevice_setupStream' makes pointer from integer without a cast [-Wint-conversion] 70 | if (SoapySDRDevice_setupStream(sdr, &rxStream, SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL) != 0) | ^~~~~~~~~~~~ | | | int In file included from /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:1: /usr/include/SoapySDR/Device.h:308:17: note: expected 'const char *' but argument is of type 'int' 308 | const char *format, | ~~~~~~~~~~~~^~~~~~ /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:70:66: warning: passing argument 4 of 'SoapySDRDevice_setupStream' from incompatible pointer type [-Wincompatible-pointer-types] 70 | if (SoapySDRDevice_setupStream(sdr, &rxStream, SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL) != 0) | ^~~~~~~~~~~~~~ | | | char * In file included from /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:1: /usr/include/SoapySDR/Device.h:309:19: note: expected 'const size_t *' {aka 'const long unsigned int *'} but argument is of type 'char *' 309 | const size_t *channels, | ~~~~~~~~~~~~~~^~~~~~~~ /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:70:82: warning: passing argument 5 of 'SoapySDRDevice_setupStream' makes integer from pointer without a cast [-Wint-conversion] 70 | if (SoapySDRDevice_setupStream(sdr, &rxStream, SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL) != 0) | ^~~~ | | | void * In file included from /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:1: /usr/include/SoapySDR/Device.h:310:18: note: expected 'size_t' {aka 'const long unsigned int'} but argument is of type 'void *' 310 | const size_t numChans, | ~~~~~~~~~~~~~^~~~~~~~ /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:70:9: error: too many arguments to function 'SoapySDRDevice_setupStream' 70 | if (SoapySDRDevice_setupStream(sdr, &rxStream, SOAPY_SDR_RX, SOAPY_SDR_CF32, NULL, 0, NULL) != 0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /build/libxtrx-0.0.1+git20191219.98458ce/soapy/test_xtrx_soapy.c:1: /usr/include/SoapySDR/Device.h:306:31: note: declared here 306 | SOAPY_SDR_API SoapySDRStream *SoapySDRDevice_setupStream(SoapySDRDevice *device, | ^~~~~~~~~~~~~~~~~~~~~~~~~~