Hi,

On Tue, Jun 17, 2014 at 03:44:23AM +0000, Serge Hallyn wrote:
> Date: Tue, 17 Jun 2014 03:44:23 +0000
> From: Serge Hallyn <[email protected]>
> To: [email protected]
> Subject: Re: [lxc-users] Failure to compile with gcc 4.9.0 due to
>  -Werror=maybe-unitialized
> User-Agent: Mutt/1.5.21 (2010-09-15)
> 
> 
> The compiler is being stupid, but if it's causing you trouble feel
> feel free to send a patch to initialize saveptr to NULL.
> 

I am attaching the patch which fixes the build for me. I'm not sure that you
want to apply it though, given that only Archlinux seems to be affected at the
moment...

Thanks,
-- 
Leonid Isaev
GPG fingerprints: DA92 034D B4A8 EC51 7EA6  20DF 9291 EE8A 043C B8C4
                  C0DF 20D0 C075 C3F1 E1BE  775A A7AE F6CB 164B 5A6D
From: Leonid Isaev <[email protected]>
Date: Wed, 18 Jun 2014 00:21:25 +0000
Subject: [PATCH] bdev.c: initialize a pointer to avoid build failures with
 -Werror=maybe-uninitialized

Signed-off-by: Leonid Isaev <[email protected]>
---
 src/lxc/bdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c
index c0051e6..2ed0b96 100644
--- a/src/lxc/bdev.c
+++ b/src/lxc/bdev.c
@@ -3097,7 +3097,7 @@ struct bdev *bdev_create(const char *dest, const char *type,
 
 	// -B lvm,dir
 	if (index(type, ',') != NULL) {
-		char *dup = alloca(strlen(type)+1), *saveptr, *token;
+		char *dup = alloca(strlen(type)+1), *saveptr = NULL, *token;
 		strcpy(dup, type);
 		for (token = strtok_r(dup, ",", &saveptr); token;
 				token = strtok_r(NULL, ",", &saveptr)) {
-- 
2.0.0

Attachment: pgpUFYbOOijKs.pgp
Description: PGP signature

_______________________________________________
lxc-users mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to