svn commit: samba r17645 - in branches/SAMBA_4_0/source/lib/talloc:
.
tridge at samba.org
tridge at samba.org
Mon Aug 21 01:27:23 GMT 2006
Author: tridge
Date: 2006-08-21 01:27:22 +0000 (Mon, 21 Aug 2006)
New Revision: 17645
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17645
Log:
gcc 4.1.x has started producing "value computed is not used" warnings
in very annoying ways for talloc_steal. This rather strange looking
cpp approach avoids these warnings. It's really a problem in gcc, but
better to do this than put up with the huge flood of warnings.
Modified:
branches/SAMBA_4_0/source/lib/talloc/talloc.h
Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.h
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.h 2006-08-21 01:25:20 UTC (rev 17644)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.h 2006-08-21 01:27:22 UTC (rev 17645)
@@ -62,10 +62,14 @@
_talloc_set_destructor((ptr), (void *)_talloc_destructor_fn); \
} while(0)
#define _TALLOC_CHECK_TYPE(type,val)
+/* this extremely strange macro is to avoid some braindamaged warning
+ stupidity in gcc 4.1.x */
+#define talloc_steal(ctx, ptr) ({ __typeof__(ptr) __talloc_steal_ret = (__typeof__(ptr))_talloc_steal((ctx),(ptr)); __talloc_steal_ret; })
#else
#define talloc_set_destructor(ptr, function) \
_talloc_set_destructor((ptr), (int (*)(void *))(function))
#define _TALLOC_TYPEOF(ptr) void *
+#define talloc_steal(ctx, ptr) (_TALLOC_TYPEOF(ptr))_talloc_steal((ctx),(ptr))
#endif
/* useful macros for creating type checked pointers */
@@ -90,7 +94,6 @@
#define talloc_get_type(ptr, type) (type *)talloc_check_name(ptr, #type)
#define talloc_find_parent_bytype(ptr, type) (type *)talloc_find_parent_byname(ptr, #type)
-#define talloc_steal(ctx, ptr) (_TALLOC_TYPEOF(ptr))_talloc_steal((ctx),(ptr))
#if TALLOC_DEPRECATED
#define talloc_zero_p(ctx, type) talloc_zero(ctx, type)
More information about the samba-cvs
mailing list