[Bug build/22495] New: remote-sim.c should be built with -Wno-format-literal

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] New: remote-sim.c should be built with -Wno-format-literal

macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

            Bug ID: 22495
           Summary: remote-sim.c should be built with -Wno-format-literal
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: kryukov at frtk dot ru
  Target Milestone: ---

Hi

remote-sim.c contains calls of `vfprintf_filtered` function with non-literal
format. Clang is able to track that if '-Wformat-literal' warning is enabled,
leading to compilation failure:

clang++-5.0 -x c++ -std=gnu++11 -g -O2   -I. -I. -I./common -I./config
-DLOCALEDIR="\"/home/travis/build/pavelkryukov/gnu-binutils-clang/binutils-gdb/cross/mips/share/locale\""
-DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/..
-I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber
-I./gnulib/import -Ibuild-gnulib/import   -DTUI=1  -I/usr/include/python2.7
-I/usr/include/python2.7 -Wall -Wpointer-arith -Wno-unused -Wunused-value
-Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body
-Wno-sign-compare -Wno-narrowing -Wno-mismatched-tags -Wformat-nonliteral
-Werror -c -o remote-sim.o -MT remote-sim.o -MMD -MP -MF ./.deps/remote-sim.Tpo
remote-sim.c
remote-sim.c:386:34: error: format string is not a string literal
      [-Werror,-Wformat-nonliteral]
  vfprintf_filtered (gdb_stdout, format, args);

As a workaround, we may add an exception for `remote-sim.c` in the same manner
as for `target-float.c`. I pushed a patch to master branch of this repository:

https://github.com/pavelkryukov/binutils-gdb.git

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

Pavel I. Kryukov <kryukov at frtk dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|remote-sim.c should be      |remote-sim.c should be
                   |built with                  |built with
                   |-Wno-format-literal         |-Wno-format-nonliteral

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

Pavel I. Kryukov <kryukov at frtk dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at sourceware dot org

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

Pavel I. Kryukov <kryukov at frtk dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at ericsson dot com

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

Pavel I. Kryukov <kryukov at frtk dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Pavel I. Kryukov <kryukov at frtk dot ru> ---
Fixed
(https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=6e8c24fe27098f407000812e61fa8210095a7970)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

--- Comment #2 from Simon Marchi <simon.marchi at ericsson dot com> ---
The patch you linked doesn't seem related to remote-sim.c.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

--- Comment #3 from Pavel I. Kryukov <kryukov at frtk dot ru> ---
My fault, sorry. However,  the same warning is triggered in remote-sim.c, so
the same patch may be applied.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

Pavel I. Kryukov <kryukov at frtk dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |---

--- Comment #4 from Pavel I. Kryukov <kryukov at frtk dot ru> ---
Reopened as Clang is still unable to build the file

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

--- Comment #5 from Pavel I. Kryukov <kryukov at frtk dot ru> ---
Clang still refuses to build remote-sim.c, could anyone please take a look?

Command line:
> ./configure --target=mipsel-unknown-linux-gnu --with-system-zlib && make && make install

Clang command line and output:

clang++-5.0 -x c++ -std=gnu++11 -g -O2   -I. -I. -I./common -I./config
-DLOCALEDIR="\"/home/travis/build/pavelkryukov/gnu-binutils-clang/binutils-gdb/cross/mips/share/locale\""
-DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/..
-I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber
-I./gnulib/import -Ibuild-gnulib/import   -DTUI=1  -I/usr/include/python2.7
-I/usr/include/python2.7 -Wall -Wpointer-arith -Wno-unused -Wunused-value
-Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body
-Wno-sign-compare -Wno-narrowing -Wno-mismatched-tags -Wformat-nonliteral
-Werror -c -o remote-sim.o -MT remote-sim.o -MMD -MP -MF ./.deps/remote-sim.Tpo
remote-sim.c
remote-sim.c:386:34: error: format string is not a string literal
      [-Werror,-Wformat-nonliteral]
  vfprintf_filtered (gdb_stdout, format, args);
                                 ^~~~~~
remote-sim.c:395:34: error: format string is not a string literal
      [-Werror,-Wformat-nonliteral]
  vfprintf_filtered (gdb_stdout, format, ap);
                                 ^~~~~~
remote-sim.c:403:34: error: format string is not a string literal
      [-Werror,-Wformat-nonliteral]
  vfprintf_filtered (gdb_stderr, format, ap);
                                 ^~~~~~
remote-sim.c:414:11: error: format string is not a string literal
      [-Werror,-Wformat-nonliteral]
  verror (format, args);
          ^~~~~~
4 errors generated.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Simon Marchi <simon.marchi at ericsson dot com> ---
Fixed by

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=7104e59bece90e387d70f617eb7ed4c34087283d

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

Pavel I. Kryukov <kryukov at frtk dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

--- Comment #7 from Pavel I. Kryukov <kryukov at frtk dot ru> ---
Thanks!

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug build/22495] remote-sim.c should be built with -Wno-format-nonliteral

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22495

Jeremi <jeremip11 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeremip11 at gmail dot com

--
You are receiving this mail because:
You are on the CC list for the bug.