Format string warnings on 32 bit platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: This is a digitally signed message part.

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

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux