gdb: fix format string warnings in f-lang.c
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 19 Nov 2020 16:31:34 +0000 (11:31 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 19 Nov 2020 16:32:26 +0000 (11:32 -0500)
commita5adb8f3b40184cfe8f0bfd362ba1d37d780d62f
tree85ec122536becc355df7a85907540d54917b428e
parent70125a45e426167957fc5c5255e7a1e381d688f9
gdb: fix format string warnings in f-lang.c

I get a bunch of these warnings when compiling for i386 (32-bit):

      CXX    f-lang.o
    /home/simark/src/binutils-gdb/gdb/f-lang.c: In function 'value* fortran_value_subarray(value*, expression*, int*, int, noside)':
    /home/simark/src/binutils-gdb/gdb/f-lang.c:453:48: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'LONGEST' {aka 'long long int'} [-Werror=format=]
      453 |        debug_printf ("|   |   |-> Low bound: %ld\n", lb);
          |                                              ~~^     ~~
          |                                                |     |
          |                                                |     LONGEST {aka long long int}
          |                                                long int
          |                                              %lld

Fix them by using plongest/pulongest.

gdb/ChangeLog:

* f-lang.c (fortran_value_subarray): Use plongest/pulongest.

Change-Id: I666ead5593653d5a1a3dab2ffdc72942c928c7d2
gdb/ChangeLog
gdb/f-lang.c