WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxc: Fix gcc 4.3 build failure

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxc: Fix gcc 4.3 build failure
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Mon, 8 Dec 2008 10:04:46 +0900
Delivery-date: Sun, 07 Dec 2008 17:05:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
gcc-4.3.2-1ubuntu11 complains:

xc_dom_x86.c: In function 'start_info_x86_32':
xc_dom_x86.c:421: error: format not a string literal and no format arguments
xc_dom_x86.c:421: error: format not a string literal and no format arguments
xc_dom_x86.c: In function 'start_info_x86_64':
xc_dom_x86.c:460: error: format not a string literal and no format arguments
xc_dom_x86.c:460: error: format not a string literal and no format arguments


Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r cc82d54bedfd tools/libxc/xc_dom_x86.c
--- a/tools/libxc/xc_dom_x86.c  Fri Dec 05 15:54:22 2008 +0000
+++ b/tools/libxc/xc_dom_x86.c  Mon Dec 08 09:26:15 2008 +0900
@@ -418,7 +418,8 @@ static int start_info_x86_32(struct xc_d
     xc_dom_printf("%s: called\n", __FUNCTION__);
 
     memset(start_info, 0, sizeof(*start_info));
-    snprintf(start_info->magic, sizeof(start_info->magic), dom->guest_type);
+    strncpy(start_info->magic, dom->guest_type, sizeof(start_info->magic));
+    start_info->magic[sizeof(start_info->magic) - 1] = '\0';
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
@@ -457,7 +458,8 @@ static int start_info_x86_64(struct xc_d
     xc_dom_printf("%s: called\n", __FUNCTION__);
 
     memset(start_info, 0, sizeof(*start_info));
-    snprintf(start_info->magic, sizeof(start_info->magic), dom->guest_type);
+    strncpy(start_info->magic, dom->guest_type, sizeof(start_info->magic));
+    start_info->magic[sizeof(start_info->magic) - 1] = '\0';
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libxc: Fix gcc 4.3 build failure, Kouya Shimura <=