jackaudio / jack1

jack1 codebase
Other
250 stars 70 forks source link

0.126.0 fails to build: `intclient.c: error: conflicting types for 'jack_internal_client_handle'` #120

Closed barracuda156 closed 2 days ago

barracuda156 commented 2 days ago
intclient.c: In function 'jack_get_internal_client_name':
intclient.c:105:25: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
  105 |         jack_uuid_copy (&req.x.intclient.uuid, intclient);
      |                         ^~~~~~~~~~~~~~~~~~~~~
intclient.c: At top level:
intclient.c:122:1: error: conflicting types for 'jack_internal_client_handle'; have 'int(jack_client_t *, const char *, jack_status_t *, jack_intclient_t *)' {aka 'int(struct _jack_client *, const char *, enum JackStatus *, long long unsigned int *)'}
  122 | jack_internal_client_handle (jack_client_t *client,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from intclient.c:28:
/opt/local/include/jack/intclient.h:69:5: note: previous declaration of 'jack_internal_client_handle' with type 'int(jack_client_t *, const char *, jack_status_t *, jack_intclient_t)' {aka 'int(struct _jack_client *, const char *, enum JackStatus *, long long unsigned int)'}
   69 | int jack_internal_client_handle (jack_client_t *client,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
intclient.c: In function 'jack_internal_client_unload':
intclient.c:206:33: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
  206 |                 jack_uuid_copy (&req.x.intclient.uuid, intclient);
      |                                 ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [libjackcommon_la-intclient.lo] Error 1
falkTX commented 2 days ago

your system includes /opt/local/include/jack/intclient.h from jack2, which is incompatible with jack1.

barracuda156 commented 2 days ago

@falkTX I do not have jack2 due to https://github.com/jackaudio/jack2/issues/950 However you should be right re cause of the issue being pre-installed version of jack: I have 0.124.1 currently. I will see how to neatly avoid the issue.

barracuda156 commented 2 days ago

Yeah, that is the case. With correct headers, that error is gone.

I get this now:

coreaudio_driver.c:804:32: error: returning 'int' from a function with return type 'jack_driver_t *' {aka 'struct _jack_driver *'} makes pointer from integer without a cast [-Wint-conversion]
  804 |                         return -1;
      |                                ^
coreaudio_driver.c:806:17: warning: 'AudioDeviceSetProperty' is deprecated [-Wdeprecated-declarations]
  806 |                 err = AudioDeviceSetProperty (driver->device_id, NULL, 0, kAudioDeviceSectionGlobal, kAudioDevicePropertyNominalSampleRate, outSize, &sampleRate);
      |                 ^~~
/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2393:1: note: declared here
 2393 | AudioDeviceSetProperty( AudioDeviceID           inDevice,
      | ^~~~~~~~~~~~~~~~~~~~~~
coreaudio_driver.c:810:32: error: returning 'int' from a function with return type 'jack_driver_t *' {aka 'struct _jack_driver *'} makes pointer from integer without a cast [-Wint-conversion]
  810 |                         return -1;
      |                                ^
coreaudio_driver.c:821:17: warning: 'AudioDeviceRemovePropertyListener' is deprecated [-Wdeprecated-declarations]
  821 |                 AudioDeviceRemovePropertyListener (driver->device_id, 0, true, kAudioDevicePropertyNominalSampleRate, sr_notification);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2449:1: note: declared here
 2449 | AudioDeviceRemovePropertyListener(  AudioDeviceID                   inDevice,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coreaudio_driver.c:996:9: warning: 'AudioDeviceAddPropertyListener' is deprecated [-Wdeprecated-declarations]
  996 |         err = AudioDeviceAddPropertyListener (driver->device_id, 0, true, kAudioDeviceProcessorOverload, notification, driver);
      |         ^~~
/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2422:1: note: declared here
 2422 | AudioDeviceAddPropertyListener( AudioDeviceID                   inDevice,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coreaudio_driver.c:1002:9: warning: 'AudioDeviceAddPropertyListener' is deprecated [-Wdeprecated-declarations]
 1002 |         err = AudioDeviceAddPropertyListener (driver->device_id, 0, true, kAudioDevicePropertyNominalSampleRate, notification, driver);
      |         ^~~
/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2422:1: note: declared here
 2422 | AudioDeviceAddPropertyListener( AudioDeviceID                   inDevice,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coreaudio_driver.c: In function 'coreaudio_driver_delete':
coreaudio_driver.c:1028:9: warning: 'AudioDeviceRemovePropertyListener' is deprecated [-Wdeprecated-declarations]
 1028 |         AudioDeviceRemovePropertyListener (driver->device_id, 0, true, kAudioDeviceProcessorOverload, notification);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:2449:1: note: declared here
 2449 | AudioDeviceRemovePropertyListener(  AudioDeviceID                   inDevice,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [coreaudio_driver.lo] Error 1

Perhaps it is because of gcc14 being too strict on warnings-to-errors.

barracuda156 commented 2 days ago

Passing -Wno-error=int-conversion, I got the build to complete successfully.

barracuda156 commented 2 days ago

The headers conflict was in fact because the tarball does not include those, so the build fell back to picking those from /opt/local. I have sorted this now, so that the port fetches headers tarball and places those where the build expects them to be. Then having another version already installed does not confuse the build system. I am closing the issue, thank you very much.