This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 08/16] libiberty.h: Provide a CLEAR_VAR macro


include/ChangeLog:
	* libiberty.h (CLEAR_VAR): New macro.
---
 include/libiberty.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/libiberty.h b/include/libiberty.h
index b33dd65..93e4131 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -699,6 +699,10 @@ extern void stack_limit_increase (unsigned long);
 
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
+/* Fill an lvalue with zero bits.  */
+#define CLEAR_VAR(S) \
+  do { memset (&(S), 0, sizeof (S)); } while (0)
+
 /* Drastically simplified alloca configurator.  If we're using GCC,
    we use __builtin_alloca; otherwise we use the C alloca.  The C
    alloca is always available.  You can override GCC by defining
-- 
1.8.5.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]