alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
345 stars 176 forks source link

alsa-lib fails test with clang-16 #323

Closed fsvm88 closed 11 months ago

fsvm88 commented 1 year ago

Hello,

While building is fine, testing alsa-lib on Gentoo fails since clang-16, due to clang-16 defaulting to c99.

The problem is at alsa-lib-1.2.8/test/oldapi.c, in the typedef declaration, which leads to the following error:

alsa-lib-1.2.8/test/oldapi.c:40:6: error: incompatible function pointer types assigning to 'myfcn *' (aka 'void (*)(void *)') from 'int (*)(const snd_pcm_hw_params_t *)' (aka 'int (*)(const struct _snd_pcm_hw_params *)') [-Werror,-Wincompatible-func
        fcn = &snd_pcm_hw_params_get_access;
            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is the Gentoo bug with all the information

I have created a patch based on the compiler's suggestion, but I'm not sure if it's the right way to solve this.