[libvirt] [PATCH] Temporarily disable format truncation warnings

Daniel P. Berrange posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170615133334.12938-1-berrange@redhat.com
m4/virt-compile-warnings.m4 | 4 ++++
1 file changed, 4 insertions(+)
[libvirt] [PATCH] Temporarily disable format truncation warnings
Posted by Daniel P. Berrange 6 years, 10 months ago
GCC 7.1 introduces a new -Wformat-truncation warning
flag that reports if it thinks the maximum possible
size of the formatted output will exceed the provided
fixed buffer. This is enabled automatically by the
-Wformat warning flag. There are quite a few places
hit by this in libvirt which need rewriting. This is
non-trivial work in some places, so temporarily
disable the new warning until those fixes can be
implemented.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 m4/virt-compile-warnings.m4 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index d7bb172f3..fa0940fc6 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -169,6 +169,10 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
       wantwarn="$wantwarn -Wno-format"
     fi
 
+    # -Wformat enables this by default, and we should keep it,
+    # but need to rewrite various areas of code first
+    wantwarn="$wantwarn -Wno-format-truncation"
+
     # This should be < 256 really. Currently we're down to 4096,
     # but using 1024 bytes sized buffers (mostly for virStrerror)
     # stops us from going down further
-- 
2.13.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Temporarily disable format truncation warnings
Posted by Martin Kletzander 6 years, 10 months ago
On Thu, Jun 15, 2017 at 02:33:34PM +0100, Daniel P. Berrange wrote:
>GCC 7.1 introduces a new -Wformat-truncation warning
>flag that reports if it thinks the maximum possible
>size of the formatted output will exceed the provided
>fixed buffer. This is enabled automatically by the
>-Wformat warning flag. There are quite a few places
>hit by this in libvirt which need rewriting. This is
>non-trivial work in some places, so temporarily
>disable the new warning until those fixes can be
>implemented.
>
>Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
>---
> m4/virt-compile-warnings.m4 | 4 ++++
> 1 file changed, 4 insertions(+)
>

I was missing some mails when I was suggesting the same in another
thread.  ACK from me, hopefully this will just be temporary.  Maybe we
should add an idea to bugzilla or wiki to the list of TODOs?

>diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
>index d7bb172f3..fa0940fc6 100644
>--- a/m4/virt-compile-warnings.m4
>+++ b/m4/virt-compile-warnings.m4
>@@ -169,6 +169,10 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
>       wantwarn="$wantwarn -Wno-format"
>     fi
>
>+    # -Wformat enables this by default, and we should keep it,
>+    # but need to rewrite various areas of code first
>+    wantwarn="$wantwarn -Wno-format-truncation"
>+
>     # This should be < 256 really. Currently we're down to 4096,
>     # but using 1024 bytes sized buffers (mostly for virStrerror)
>     # stops us from going down further
>--
>2.13.1
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list