Skip to contentSkip to conversation

block/ssh: Add missing gcc format attributes

PATCH Applied Stefan Weil 3 participants 6 messages Apr 18, 2013 – Apr 19, 2013 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/ssh: Add missing gcc format attributes

Now gcc will check whether format string and variable arguments match.

---

Please note: I could only run limited tests with the new code because ssh.c is currently not compiled in my w32/w64 environment.

Regards,
Stefan W.

 block/ssh.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/ssh.c +2 -2
index 8f78e2e..b4e048c 100644
@@ -109,7 +109,7 @@ static void ssh_state_free(BDRVSSHState *s)
 /* Wrappers around error_report which make sure to dump as much
  * information from libssh2 as possible.
  */
-static void
+static void GCC_FMT_ATTR(2, 3)
 session_error_report(BDRVSSHState *s, const char *fs, ...)
 {
     va_list args;
@@ -132,7 +132,7 @@ session_error_report(BDRVSSHState *s, const char *fs, ...)
     error_printf("\n");
 }
 
-static void
+static void GCC_FMT_ATTR(2, 3)
 sftp_error_report(BDRVSSHState *s, const char *fs, ...)
 {
     va_list args;
Signature · 1 line
1.7.10.4
#1 lore raw

[Qemu-devel] block/ssh: Compilation fails on Debian squeeze

Am 18.04.2013 22:21, schrieb Stefan Weil:

Quoted 10 lines

Now gcc will check whether format string and variable arguments match.

---

Please note: I could only run limited tests with the new code because ssh.c is currently not compiled in my w32/w64 environment.

Regards,
Stefan W.

The test fails on current Debian (squeeze), not because of wrong format specifiers, but because of an "old" libssh2-1-dev.

ssh.c calls libssh2_session_handshake which was added in 1.2.8, see http://www.libssh2.org/libssh2_session_handshake.html.

Can we simplify the libssh2 check in configure and require pkg-config, no compile check?

Regards,
Stefan W.

#2 lore raw

Re: [Qemu-devel] block/ssh: Compilation fails on Debian squeeze

Quoted 12 lines · Stefan Weil

Am 18.04.2013 22:21, schrieb Stefan Weil:

Quoted 10 lines

Now gcc will check whether format string and variable arguments match.

---

Please note: I could only run limited tests with the new code because ssh.c is currently not compiled in my w32/w64 environment.

Regards,
Stefan W.

Quoted 8 lines

The test fails on current Debian (squeeze), not because of wrong format specifiers, but because of an "old" libssh2-1-dev.

ssh.c calls libssh2_session_handshake which was added in 1.2.8, see http://www.libssh2.org/libssh2_session_handshake.html.

Can we simplify the libssh2 check in configure and require pkg-config, no compile check?

Sounds fine to me. Did you mean you want me to provide a patch?

Rich.

Signature · 4 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
#3 lore raw

Re: [Qemu-devel] block/ssh: Compilation fails on Debian squeeze

Am 18.04.2013 23:08, schrieb Richard W.M. Jones:

Quoted 13 lines · Stefan Weil
Quoted 8 lines

The test fails on current Debian (squeeze), not because of wrong format specifiers, but because of an "old" libssh2-1-dev.

ssh.c calls libssh2_session_handshake which was added in 1.2.8, see http://www.libssh2.org/libssh2_session_handshake.html.

Can we simplify the libssh2 check in configure and require pkg-config, no compile check?

Sounds fine to me. Did you mean you want me to provide a patch?

Rich.

Yes, that would be good.

Stefan

#4 lore raw
In reply to Stefan Weil
Quoted 3 lines · Stefan Weil

Now gcc will check whether format string and variable arguments match.

ACK, this looks fine to me.

Rich.

Signature · 4 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
#5 lore raw
In reply to Stefan Weil
Quoted 5 lines · Stefan Weil

Now gcc will check whether format string and variable arguments match.

---

Quoted 8 lines

Please note: I could only run limited tests with the new code because ssh.c is currently not compiled in my w32/w64 environment.

Regards,
Stefan W.

 block/ssh.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan