All of lore.kernel.org
 help / color / mirror / Atom feed
* [alsa-devel] Format string warnings on 32 bit platforms
@ 2020-01-21 11:10 Rolf Eike Beer
  0 siblings, 0 replies; only message in thread
From: Rolf Eike Beer @ 2020-01-21 11:10 UTC (permalink / raw)
  To: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 5428 bytes --]

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"),
      |                     ^

-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source

Besuchen Sie uns auf der Embedded World 2020 in Nürnberg!
-> Halle 4, Stand 368

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-21 11:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-21 11:10 [alsa-devel] Format string warnings on 32 bit platforms Rolf Eike Beer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.