[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-154-g826ee30

Tim Prouty tprouty at samba.org
Fri Jul 3 22:43:43 GMT 2009

On Jun 30, 2009, at 10:16 PM, Andrew Tridgell wrote

> commit 5fe1d8dc1275e43d96da1297f5fb0d0088a1c3ab
> Author: Andrew Tridgell <tridge at samba.org>
> Date:   Wed Jul 1 14:53:01 2009 +1000
>   changes to remove the ambiguity in talloc_free() and talloc_steal()

Tridge, this patch introduced two new warnings that should be fixed.

Compiling ../lib/talloc/talloc.c
cc1: warnings being treated as errors
../lib/talloc/talloc.c: In function 'talloc_reparent':
../lib/talloc/talloc.c:726: warning: return discards qualifiers from  
pointer target type
../lib/talloc/talloc.c: In function '_talloc_move':
../lib/talloc/talloc.c:1186: warning: initialization discards  
qualifiers from pointer target type

726: In talloc_reparent you can't take in a const void *, and then  
return it as a void *.

1186: The second one is actually happening in the talloc_steal macro  
and could be fixed by actually discarding the const:

@@ -1182,7 +1182,7 @@ void *_talloc_realloc(const void *context, void  
*ptr, size_t size, const char *n
void *_talloc_move(const void *new_ctx, const void *_pptr)
-       const void **pptr = discard_const_p(const void *,_pptr);
+       void **pptr = discard_const_p(void *,_pptr);
        void *ret = talloc_steal(new_ctx, *pptr);
        (*pptr) = NULL;
        return ret;

More information about the samba-cvs mailing list