[alsa-devel] Format string warnings on 32 bit platforms
The first ones can be fixed by either casting to "unsigned long long" and using that specifier or using the proper format specifiers from inttypes.h
Greetings,
Eike
container.c: In function 'container_context_pre_process': container.c:359:33: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=] 359 | fprintf(stderr, " frames: %lu\n", | ~~^ | | | long unsigned int | %llu 360 | *frame_count); | ~~~~~~~~~~~~ | | | uint64_t {aka long long unsigned int} container.c:362:37: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=] 362 | fprintf(stderr, " max frames: %lu\n", | ~~^ | | | long unsigned int | %llu 363 | *frame_count); | ~~~~~~~~~~~~ | | | uint64_t {aka long long unsigned int} container.c: In function 'container_context_post_process': container.c:430:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=] 430 | fprintf(stderr, " Handled bytes: %lu\n", | ~~^ | | | long unsigned int | %llu 431 | cntr->handled_byte_count); | ~~~~~~~~~~~~~~~~~~~~~~~~ | | | uint64_t {aka long long unsigned int} subcmd-transfer.c: In function 'context_process_frames': subcmd-transfer.c:392:20: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=] 392 | "%s: Expected %lu frames, Actual %lu frames\n", | ~~^ | | | long unsigned int | %llu 393 | snd_pcm_stream_name(direction), expected_frame_count, | ~~~~~~~~~~~~~~~~~~~~ | | | uint64_t {aka long long unsigned int} subcmd-transfer.c:392:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=] 392 | "%s: Expected %lu frames, Actual %lu frames\n", | ~~^ | | | long unsigned int | %llu 393 | snd_pcm_stream_name(direction), expected_frame_count, 394 | *actual_frame_count); | ~~~~~~~~~~~~~~~~~~~ | | | uint64_t {aka long long unsigned int} alsa.c: In function 'set_snd_pcm_params': ../include/gettext.h:13:25: warning: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'snd_pcm_uframes_t' {aka 'long unsigned int'} [-Wformat=] 13 | # define gettext(msgid) (msgid) | ^~~~~~~ ../include/gettext.h:18:18: note: in expansion of macro 'gettext' 18 | #define _(msgid) gettext (msgid) | ^~~~~~~ alsa.c:256:21: note: in expansion of macro '_' 256 | fprintf(bat->err, _("period size: %zd %s: %s(%d)\n"), | ^ ../include/gettext.h:13:25: warning: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'snd_pcm_uframes_t' {aka 'long unsigned int'} [-Wformat=] 13 | # define gettext(msgid) (msgid) | ^~~~~~~ ../include/gettext.h:18:18: note: in expansion of macro 'gettext' 18 | #define _(msgid) gettext (msgid) | ^~~~~~~ alsa.c:265:21: note: in expansion of macro '_' 265 | fprintf(bat->err, _("buffer size: %zd %s: %s(%d)\n"), | ^ ../include/gettext.h:13:25: warning: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'snd_pcm_uframes_t' {aka 'long unsigned int'} [-Wformat=] 13 | # define gettext(msgid) (msgid) | ^~~~~~~ ../include/gettext.h:18:18: note: in expansion of macro 'gettext' 18 | #define _(msgid) gettext (msgid) | ^~~~~~~ alsa.c:273:21: note: in expansion of macro '_' 273 | fprintf(bat->err, _("equal to buffer size (%zd)\n"), | ^
participants (1)
-
Rolf Eike Beer