[lxc-users] Failure to compile with gcc 4.9.0 due to -Werror=maybe-unitialized
Serge Hallyn
serge.hallyn at ubuntu.com
Tue Jun 17 03:44:23 UTC 2014
Quoting Leonid Isaev (lisaev at umail.iu.edu):
> Hi,
>
> I am trying to compile lxc git master and getting this gcc error:
> ------
> bdev.c: In function ‘bdev_create’:
> bdev.c:3104:7: error: ‘saveptr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> if ((bdev = do_bdev_create(dest, token, cname, specs)))
Odd, saveptr is actually used on line 3102 not 3104. On first call to
strtok_r, saveptr is ignored.
The compiler is being stupid, but if it's causing you trouble feel
feel free to send a patch to initialize saveptr to NULL.
> ...
More information about the lxc-users
mailing list