'./configure --enable-fixed-point --with-fft=smallft' causes '-Wincompatible-pointer-types' in libspeexdsp/fftwrap.c
With ./configure --enable-fixed-point --with-fft=smallft
, compilation of file libspeexdsp/fftwrap.c
produces -Wincompatible-pointer-types
diagnostics. This will prevent the project from being successfully built on Fedora 40 and other GNU/Linux distributions that use GCC 14 because, on GCC 14, -Wincompatible-pointer-types
is treated as an error rather than a warning.
fftwrap.c: In function 'spx_fft_float':
fftwrap.c:384:19: error: passing argument 2 of 'spx_fft' from incompatible pointer type [-Wincompatible-pointer-types]
384 | spx_fft(table, _in, _out);
| ^~~
| |
| spx_word16_t * {aka short int *}
fftwrap.c:98:34: note: expected 'float *' but argument is of type 'spx_word16_t *' {aka 'short int *'}
98 | void spx_fft(void *table, float *in, float *out)
| ~~~~~~~^~
fftwrap.c:384:24: error: passing argument 3 of 'spx_fft' from incompatible pointer type [-Wincompatible-pointer-types]
384 | spx_fft(table, _in, _out);
| ^~~~
| |
| spx_word16_t * {aka short int *}
fftwrap.c:98:45: note: expected 'float *' but argument is of type 'spx_word16_t *' {aka 'short int *'}
98 | void spx_fft(void *table, float *in, float *out)
| ~~~~~~~^~~
fftwrap.c: In function 'spx_ifft_float':
fftwrap.c:420:20: error: passing argument 2 of 'spx_ifft' from incompatible pointer type [-Wincompatible-pointer-types]
420 | spx_ifft(table, _in, _out);
| ^~~
| |
| spx_word16_t * {aka short int *}
fftwrap.c:116:35: note: expected 'float *' but argument is of type 'spx_word16_t *' {aka 'short int *'}
116 | void spx_ifft(void *table, float *in, float *out)
| ~~~~~~~^~
fftwrap.c:420:25: error: passing argument 3 of 'spx_ifft' from incompatible pointer type [-Wincompatible-pointer-types]
420 | spx_ifft(table, _in, _out);
| ^~~~
| |
| spx_word16_t * {aka short int *}
fftwrap.c:116:46: note: expected 'float *' but argument is of type 'spx_word16_t *' {aka 'short int *'}
116 | void spx_ifft(void *table, float *in, float *out)
| ~~~~~~~^~~
To reproduce this issue:
-
Clone this repository and enter the directory containing the clone
-
Run
./autogen.sh
-
If
gcc --version
reports GCC 14 or above, run./configure --enable-fixed-point --with-fft=smallft
;Otherwise, run
CFLAGS="-Werror=incompatible-pointer-types" ./configure --enable-fixed-point --with-fft=smallft
-
Run
make