[lxc-devel] [PATCH] fix minor gcc 4.7.2 error

Stéphane Graber stgraber at ubuntu.com
Tue May 21 17:18:20 UTC 2013


On 05/21/2013 01:15 PM, Dwight Engen wrote:
> lxccontainer.c:874:4: error: ‘for’ loop initial declarations are only
> allowed in C99 mode
> 
> Signed-off-by: Dwight Engen <dwight.engen at oracle.com>

Oops, forgot to test-build with that last minute change...

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/lxccontainer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
> index 7ce25c6..2934afa 100644
> --- a/src/lxc/lxccontainer.c
> +++ b/src/lxc/lxccontainer.c
> @@ -871,7 +871,8 @@ out:
>  		count++;
>  		temp = realloc(addresses, count * sizeof(*addresses));
>  		if (!temp) {
> -			for (int i = 0; i < count-1; i++)
> +			int i;
> +			for (i = 0; i < count-1; i++)
>  				free(addresses[i]);
>  			free(addresses);
>  			return NULL;
> 


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130521/80059adb/attachment.pgp>


More information about the lxc-devel mailing list