ignore-value: support aggregate types
[pspp] / lib / ignore-value.h
index 8f60b0e60d5e244000db8499992e05d7f7744e43..52804dc23b375b37969dfb698e53811baffcc917 100644 (file)
 #  endif
 # endif
 
-static inline void _ignore_value (intptr_t p) { (void) p; }
-# define ignore_value(x) _ignore_value ((intptr_t) x)
+# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
+#  define ignore_value(x) ((void) (x))
+# else
+#  define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
+# endif
 
 /* ignore_value works for both scalars and pointers; deprecate ignore_ptr.  */
 static inline void ATTRIBUTE_DEPRECATED
 ignore_ptr (void *p) { (void) p; } /* deprecated: use ignore_value */
 
-/* FIXME: what about aggregate types? */
-
 #endif