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] fix xenstored build error

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] fix xenstored build error
From: "Charles Coffing" <ccoffing@xxxxxxxxxx>
Date: Fri, 08 Jun 2007 16:47:43 -0400
Delivery-date: Fri, 08 Jun 2007 13:46:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
tools/xenstore/Makefile includes -Werror, so warnings are fatal.  I just hit 
this:

gcc  -O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2  
-g -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall -Wstrict-prototypes 
-Wno-unused-value -Wdeclaration-after-statement  -m32 -march=i686 -DNDEBUG 
-std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value 
-Wdeclaration-after-statement  -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall 
-Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  
-D__XEN_TOOLS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs -m32 -march=i686 -DNDEBUG 
-std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value 
-Wdeclaration-after-statement  -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-mno-tls-direct-seg-refs -Werror -Wp,-MD,.utils.o.d  -I../../tools/libxc -I. -c 
-o utils.o utils.c
cc1: warnings being treated as errors
utils.c: In function 'barf':
utils.c:35: warning: ignoring return value of 'vasprintf', declared with 
attribute warn_unused_result
utils.c: In function 'barf_perror':
utils.c:52: warning: ignoring return value of 'vasprintf', declared with 
attribute warn_unused_result

Indeed, if vasprintf fails to allocate memory, then the process could crash.  
(True, this is on an exit path anyway, but crashing is nevertheless poor 
manners...)  The attached patch handles failed allocations more gracefully, 
which in turn allows my builds to complete.

Please apply to xen-unstable.

Signed-off-by:  Charles Coffing <ccoffing@xxxxxxxxxx>

Attachment: xenstored-warnings.diff
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix xenstored build error, Charles Coffing <=