Source: hacktv
Version: 0+git20201203-1
Severity: important
Tags: ftbfs upstream 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 hacktv when building against the new
libsoapysdr. Upstream does not appear to have a fix yet, one way would
be using preprocessor directives to discriminate between API version
using SOAPY_SDR_API_VERSION.

Log of the failed build:

soapysdr.c: In function 'rf_soapysdr_open':
soapysdr.c:135:39: warning: passing argument 2 of 'SoapySDRDevice_setupStream' 
makes integer from pointer without a cast [-Wint-conversion]
  135 |  if(SoapySDRDevice_setupStream(rf->d, &rf->s, SOAPY_SDR_TX, 
SOAPY_SDR_CS16, NULL, 0, NULL) != 0)
      |                                       ^~~~~~
      |                                       |
      |                                       SoapySDRStream **
In file included from soapysdr.c:20:
/usr/include/SoapySDR/Device.h:307:15: note: expected 'int' but argument is of 
type 'SoapySDRStream **'
  307 |     const int direction,
      |     ~~~~~~~~~~^~~~~~~~~
soapysdr.c:135:61: warning: passing argument 4 of 'SoapySDRDevice_setupStream' 
from incompatible pointer type [-Wincompatible-pointer-types]
  135 |  if(SoapySDRDevice_setupStream(rf->d, &rf->s, SOAPY_SDR_TX, 
SOAPY_SDR_CS16, NULL, 0, NULL) != 0)
      |                                                             
^~~~~~~~~~~~~~
      |                                                             |
      |                                                             char *
In file included from soapysdr.c:20:
/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,
      |     ~~~~~~~~~~~~~~^~~~~~~~
soapysdr.c:135:77: warning: passing argument 5 of 'SoapySDRDevice_setupStream' 
makes integer from pointer without a cast [-Wint-conversion]
  135 |  if(SoapySDRDevice_setupStream(rf->d, &rf->s, SOAPY_SDR_TX, 
SOAPY_SDR_CS16, NULL, 0, NULL) != 0)
      |                                                                         
    ^~~~
      |                                                                         
    |
      |                                                                         
    void *
In file included from soapysdr.c:20:
/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,
      |     ~~~~~~~~~~~~~^~~~~~~~
soapysdr.c:135:5: error: too many arguments to function 
'SoapySDRDevice_setupStream'
  135 |  if(SoapySDRDevice_setupStream(rf->d, &rf->s, SOAPY_SDR_TX, 
SOAPY_SDR_CS16, NULL, 0, NULL) != 0)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from soapysdr.c:20:
/usr/include/SoapySDR/Device.h:306:31: note: declared here
  306 | SOAPY_SDR_API SoapySDRStream *SoapySDRDevice_setupStream(SoapySDRDevice 
*device,
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to