xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Compiler Warning Fix
@ 2010-04-06 18:22 Anthony Boorsma
  2010-04-07  7:11 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Anthony Boorsma @ 2010-04-06 18:22 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir.Fraser


[-- Attachment #1.1: Type: text/plain, Size: 1343 bytes --]

This patch fixes a compiler warning in the file xc_core.c. This fix is
needed because warnings are treated as errors with the new gcc in Ubuntu
9.10.

 

The fix was also included in a previous submission "[Xen-devel] [PATCH
1/1] Xen ARINC653 scheduler" and is now being resubmitted as a separate
patch.

 

Anthony Boorsma

www.DornerWorks.com

 

diff -rupN a/SW/Xen/src/tools/libxc/xc_core.c
b/SW/Xen/src/tools/libxc/xc_core.c

--- a/SW/Xen/src/tools/libxc/xc_core.c 2010-04-06 12:59:44.343043800
-0400

+++ b/SW/Xen/src/tools/libxc/xc_core.c              2010-04-06
13:01:36.359332600 -0400

@@ -321,7 +321,15 @@ elfnote_dump_none(void *args, dumpcore_r

     struct xen_dumpcore_elfnote_none_desc none;

 

     elfnote_init(&elfnote);

-    memset(&none, 0, sizeof(none));

+             /*

+             * josh holtrop <DornerWorks.com> - 2009-01-04 - avoid
compilation problem

+             * with warning "memset used with constant zero length
parameter" and

+             * warnings treated as errors with the new gcc in Ubuntu
9.10

+             */

+             if (sizeof(none) > 0)

+             {

+                memset(&none, 0, sizeof(none));

+             }

 

     elfnote.descsz = sizeof(none);

     elfnote.type = XEN_ELFNOTE_DUMPCORE_NONE;

 


[-- Attachment #1.2: Type: text/html, Size: 4702 bytes --]

[-- Attachment #2: dornerworks-compiler_warning_fix-xen-3.4.1.patch --]
[-- Type: application/octet-stream, Size: 788 bytes --]

diff -rupN a/SW/Xen/src/tools/libxc/xc_core.c b/SW/Xen/src/tools/libxc/xc_core.c
--- a/SW/Xen/src/tools/libxc/xc_core.c	2010-04-06 12:59:44.343043800 -0400
+++ b/SW/Xen/src/tools/libxc/xc_core.c	2010-04-06 13:01:36.359332600 -0400
@@ -321,7 +321,15 @@ elfnote_dump_none(void *args, dumpcore_r
     struct xen_dumpcore_elfnote_none_desc none;
 
     elfnote_init(&elfnote);
-    memset(&none, 0, sizeof(none));
+	/*
+	 * josh holtrop <DornerWorks.com> - 2009-01-04 - avoid compilation problem
+	 * with warning "memset used with constant zero length parameter" and
+	 * warnings treated as errors with the new gcc in Ubuntu 9.10
+	 */
+	if (sizeof(none) > 0)
+	{
+	   memset(&none, 0, sizeof(none));
+	}
 
     elfnote.descsz = sizeof(none);
     elfnote.type = XEN_ELFNOTE_DUMPCORE_NONE;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-07  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-06 18:22 [PATCH 1/1] Compiler Warning Fix Anthony Boorsma
2010-04-07  7:11 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).