From: Kouya Shimura Subject: [PATCH] libxc: Fix gcc 4.3 build failure Date: Mon, 8 Dec 2008 10:04:46 +0900 Message-ID: <7kmyf74guo.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LPUMG3Tuuz" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --LPUMG3Tuuz Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit 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 --LPUMG3Tuuz Content-Type: text/x-patch Content-Disposition: inline; filename="gcc4.3.patch" Content-Transfer-Encoding: 7bit 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; --LPUMG3Tuuz Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --LPUMG3Tuuz--