Fix: disable array/sequence compile-time type check in C
[lttng-ust.git] / include / lttng / ust-utils.h
index fa97bf3514d35c4a19b95c49e0525fa061eac102..2d55b61f24db6365a0532419afaa9f704bc352e1 100644 (file)
  * lttng_ust_is_pointer_type - check if type is a pointer
  *
  * Returns true if the type of @type is a pointer.
+ *
+ * Note: The C implementation of lttng_ust_is_pointer_type uses pointer
+ * arithmetic, which does not work on opaque pointer types.
  */
 #if defined(__cplusplus)
 #define lttng_ust_is_pointer_type(type) (std::is_pointer<type>::value)
 #else
 /* The difference between two pointers is an integer. */
 #define lttng_ust_is_pointer_type(type) \
-       (lttng_ust_is_integer_type(typeof(((type)0 - (type)0))) && !lttng_ust_is_integer_type(type))
+       (lttng_ust_is_integer_type(typeof(((type)1 - (type)1))) && !lttng_ust_is_integer_type(type))
 #endif
 
 
This page took 0.022843 seconds and 4 git commands to generate.