1.2.2: compile time warnings
gcc 9 warnings
ao_alsa.c: In function 'alsa_set_hwparams': ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_UNKNOWN' not handled in switch [-Wswitch] 333 | switch(internal->bitformat){ | ^~~~~~ ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S8' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S16_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U16_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U16_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S24_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S32_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U32_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U32_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT64_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT64_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_IEC958_SUBFRAME_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_IEC958_SUBFRAME_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_MU_LAW' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_A_LAW' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_IMA_ADPCM' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_MPEG' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_GSM' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_SPECIAL' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S24_3LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S24_3BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24_3LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24_3BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20_3LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20_3BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20_3LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20_3BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S18_3LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S18_3BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U18_3LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U18_3BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_G723_24' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_G723_24_1B' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_G723_40' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_G723_40_1B' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U8' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U16_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U32_LE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U16_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U32_BE' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_LAST' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U16' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U32' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT64' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_IEC958_SUBFRAME' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20' not handled in switch [-Wswitch] ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20' not handled in switch [-Wswitch] ao_alsa.c: In function 'alsa_set_swparams': ao_alsa.c:485:2: warning: 'snd_pcm_sw_params_set_xfer_align' is deprecated [-Wdeprecated-declarations] 485 | err = snd_pcm_sw_params_set_xfer_align(internal->pcm_handle, params, 1); | ^~~ In file included from /usr/include/alsa/asoundlib.h:54, from ao_alsa.c:39: /usr/include/alsa/pcm.h:1331:5: note: declared here 1331 | int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) __attribute__((deprecated)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ao_alsa.c: In function 'alsa_test_open': ao_alsa.c:531:26: warning: unused variable 'params' [-Wunused-variable] 531 | snd_pcm_hw_params_t *params; | ^~~~~~ ao_alsa.c: In function 'ao_plugin_play': ao_alsa.c:798:11: warning: unused variable 'ibytes' [-Wunused-variable] 798 | int ibytes = frames * ibytewidth * device->output_channels; | ^~~~~~ ao_alsa.c:791:9: warning: unused variable 'ostride' [-Wunused-variable] 791 | int ostride = obytewidth*device->output_channels; | ^~~~~~~ ao_alsa.c:790:9: warning: unused variable 'istride' [-Wunused-variable] 790 | int istride = internal->sample_size; | ^~~~~~~ ao_pulse.c: In function 'ao_plugin_close': ao_pulse.c:309:17: warning: implicit declaration of function 'nanosleep'; did you mean 'pa_msleep'? [-Wimplicit-function-declaration] 309 | while(nanosleep(&sleep,&wake)<0){ | ^~~~~~~~~ | pa_msleep ao_null.c: In function 'ao_null_set_option': ao_null.c:89:20: warning: unused variable 'internal' [-Wunused-variable] 89 | ao_null_internal *internal = (ao_null_internal *) device->internal; | ^~~~~~~~ config.c: In function 'ao_read_config_file': config.c:58:6: warning: unused variable 'end' [-Wunused-variable] 58 | int end; | ^~~ ao_wav.c: In function 'ao_wav_open': ao_wav.c:165:29: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 165 | strncpy(internal->wave.riff.id, "RIFF",4); | ~~~~~~~~~~~~~~~~~~~^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:167:29: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 167 | strncpy(internal->wave.riff.wave_id, "WAVE",4); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:169:31: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 169 | strncpy(internal->wave.format.id, "fmt ",4); | ~~~~~~~~~~~~~~~~~~~~~^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:185:29: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 185 | strncpy(internal->wave.data.id, "data",4); | ~~~~~~~~~~~~~~~~~~~^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:189:10: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 189 | strncpy(buf, internal->wave.riff.id, 4); | ^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:189:34: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign] 189 | strncpy(buf, internal->wave.riff.id, 4); | ~~~~~~~~~~~~~~~~~~~^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:191:13: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 191 | strncpy(buf+8, internal->wave.riff.wave_id, 4); | ~~~^~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:191:36: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign] 191 | strncpy(buf+8, internal->wave.riff.wave_id, 4); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:192:13: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 192 | strncpy(buf+12, internal->wave.format.id,4); | ~~~^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:192:39: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign] 192 | strncpy(buf+12, internal->wave.format.id,4); | ~~~~~~~~~~~~~~~~~~~~~^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:205:13: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 205 | strncpy(buf+60, internal->wave.data.id, 4); | ~~~^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ ao_wav.c:205:37: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign] 205 | strncpy(buf+60, internal->wave.data.id, 4); | ~~~~~~~~~~~~~~~~~~~^~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_wav.c:33: /usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~ In file included from ../include/ao/ao.h:94, from audio_out.c:54: audio_out.c: In function '_sanitize_matrix': ../include/ao/ao_private.h:201:26: warning: field precision specifier '.*' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=] 201 | fprintf(stderr,"ao_%s ERROR: " format,device->funcs->driver_info()->short_name,## args); \ | ^~~~~~~~~~~~~~~ audio_out.c:669:11: note: in expansion of macro 'aerror' 669 | aerror("Unrecognized channel name \"%.*s\" in channel matrix \"%s\"\n", | ^~~~~~ audio_out.c:669:49: note: format string is defined here 669 | aerror("Unrecognized channel name \"%.*s\" in channel matrix \"%s\"\n", | ~~^~ | | | int In file included from ../include/ao/ao.h:94, from audio_out.c:54: ../include/ao/ao_private.h:203:26: warning: field precision specifier '.*' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=] 203 | fprintf(stderr,"ERROR: " format,## args); \ | ^~~~~~~~~ audio_out.c:669:11: note: in expansion of macro 'aerror' 669 | aerror("Unrecognized channel name \"%.*s\" in channel matrix \"%s\"\n", | ^~~~~~ audio_out.c:669:49: note: format string is defined here 669 | aerror("Unrecognized channel name \"%.*s\" in channel matrix \"%s\"\n", | ~~^~ | | | int audio_out.c:668:15: warning: unused variable 'i' [-Wunused-variable] 668 | int i; | ^ At top level: audio_out.c:609:13: warning: '_swap_samples' defined but not used [-Wunused-function] 609 | static void _swap_samples(char *target_buffer, char* source_buffer, | ^~~~~~~~~~~~~ audio_out.c:406:12: warning: '_check_driver_id' defined but not used [-Wunused-function] 406 | static int _check_driver_id(int driver_id) | ^~~~~~~~~~~~~~~~ ao_au.c: In function 'ao_au_open': ao_au.c:165:15: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign] 165 | strncpy (buf + 24, internal->au.info, 4); | ~~~~^~~~ | | | unsigned char * In file included from /usr/include/features.h:450, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from ao_au.c:30: /usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *' 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^~~~~