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

[Xen-devel] Failing to build test-cpu-policy.c with GCC9


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dario Faggioli <dfaggioli@xxxxxxxx>
  • Date: Fri, 26 Jul 2019 00:50:17 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3hLjTF9L+hMdfsMoHAm9NVRCflLTHKRGwPgAtkuiwwk=; b=QjVtB5vrl5jpvS0FdZiDZ4nSVjKZSuIJ7kQBBFKRJXzmj5O9W3PzOsFX6UMPQ/t+bMSTGK3HpLuo/gqA3zwZ/NChyWfxDAfrMsVdqXgU2JUbbMcnOoOOGA1eJUaLui7niiZoGmmmUCRWHisxm8Kxc/9O/5PXYlYmNN6G7x9srs6wJ5UTHQqdFNDZGJMlU3IP5ACk6ruNEgYRYLV+WIA7+ds7xDBzwWMsOa5SaO+iiM0N0m9Sh9GCV9Cp+Wv8ZXxFMSxnspU5pvOumOyZXTMkPwzRUc8zDQ3oQf1nZ5U5zaov9eGJuLuosT9aRtI0KSaXHGBvr5qA2VooXqefJxMBiQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lWG/UAQk+LUL11mkeuuTwGj53V1ClwfyC2lijYFNJ/WCvUaChXzQW/X3QxFLok+BYJBI98npe8Ju1vsPus/MFjlj/4oLA2QAowi+gyE4ryDLoGkh0Xxns8dmK6iLcIyoU7r4UZzaA0tBVStgxPKnbUMXpRxN/yFZrxGTv8ab/fqR700SOBocayYcrq9K83+KiHracskYRlOHR+J/fWIbdFqeFsB2dxhygXsdXd/jIvunZcK85dyZQmNJXQHTsArIkybU0N2KtZLSdyLH/Op37XPDyO5838zpZiqEfVj58oDt9yDYMFRacUui0FU0kFsNC++t/T7GaxKhQisgxyVNSg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=dfaggioli@xxxxxxxx;
  • Cc: "Andrew.Cooper3@xxxxxxxxxx" <Andrew.Cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 26 Jul 2019 00:51:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVQ0wYS55fVj31VUuPy4mON27BUA==
  • Thread-topic: Failing to build test-cpu-policy.c with GCC9

Hey, Andy,

openSUSE Tumbleweed has: gcc version 9.1.1 20190703

And this fails to build test-cpu-policy.c, like this:

test-cpu-policy.c: In function ‘main’:
test-cpu-policy.c:64:18: error: ‘%.12s’ directive argument is not a 
nul-terminated string [-Werror=format-overflow=]
   64 |             fail("  Test '%.12s', expected vendor %u, got %u\n",
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test-cpu-policy.c:20:12: note: in definition of macro ‘fail’
   20 |     printf(fmt, ##__VA_ARGS__);                 \
      |            ^~~
test-cpu-policy.c:64:27: note: format string is defined here
   64 |             fail("  Test '%.12s', expected vendor %u, got %u\n",
      |                           ^~~~~
test-cpu-policy.c:44:7: note: referenced argument declared here
   44 |     } tests[] = {
      |  

Even just doing something like below, seems to fix it for me, but there
probably are better ways...

Regards

---
diff --git a/tools/tests/cpu-policy/test-cpu-policy.c 
b/tools/tests/cpu-policy/test-cpu-policy.c
index ca3b8dd45f..e0c2c56154 100644
--- a/tools/tests/cpu-policy/test-cpu-policy.c
+++ b/tools/tests/cpu-policy/test-cpu-policy.c
@@ -35,7 +35,7 @@ static void test_vendor_identification(void)
 {
     static const struct test {
         union {
-            char ident[12];
+            char ident[13];
             struct {
                 uint32_t b, d, c;
             };
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.