[PATCH 1/9] checkpoint: fix integer-pointer conversion warnings

Serge E. Hallyn serue at us.ibm.com
Wed Sep 16 07:21:37 PDT 2009


Quoting Nathan Lynch (ntl at pobox.com):
>   CC      checkpoint/process.o
> checkpoint/process.c: In function ‘checkpoint_task_struct’:
> checkpoint/process.c:97: warning: assignment makes integer from pointer without a cast
> checkpoint/process.c:98: warning: assignment makes integer from pointer without a cast
> checkpoint/process.c: In function ‘restore_task_struct’:
> checkpoint/process.c:475: warning: assignment makes pointer from integer without a cast
> checkpoint/process.c:476: warning: assignment makes pointer from integer without a cast
> 
> Signed-off-by: Nathan Lynch <ntl at pobox.com>
> ---
>  checkpoint/process.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/checkpoint/process.c b/checkpoint/process.c
> index 41566db..b7f4a43 100644
> --- a/checkpoint/process.c
> +++ b/checkpoint/process.c
> @@ -94,8 +94,8 @@ static int checkpoint_task_struct(struct ckpt_ctx *ctx, struct task_struct *t)
>  		h->exit_signal = t->exit_signal;
>  		h->pdeath_signal = t->pdeath_signal;
>  
> -		h->set_child_tid = t->set_child_tid;
> -		h->clear_child_tid = t->clear_child_tid;
> +		h->set_child_tid = (unsigned long)t->set_child_tid;
> +		h->clear_child_tid = (unsigned long)t->clear_child_tid;

But it's defined as __u64 in checkpoint_hdr.h.  So on 32-bit this cast
won't be right, right?

But a major ack to shutting this thing up.

thanks,
-serge

>  		save_task_robust_futex_list(h, t);
>  	}
>  
> @@ -472,8 +472,8 @@ static int restore_task_struct(struct ckpt_ctx *ctx)
>  		t->exit_signal = h->exit_signal;
>  		t->pdeath_signal = h->pdeath_signal;
>  
> -		t->set_child_tid = h->set_child_tid;
> -		t->clear_child_tid = h->clear_child_tid;
> +		t->set_child_tid = (void __user *)h->set_child_tid;
> +		t->clear_child_tid = (void __user *)h->clear_child_tid;
>  		restore_task_robust_futex_list(h);
>  	}
>  
> -- 
> 1.6.0.6
> 
> _______________________________________________
> Containers mailing list
> Containers at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/containers


More information about the Containers mailing list