From: Mathieu Desnoyers Date: Fri, 20 May 2022 16:00:08 +0000 (-0400) Subject: Fix: Pointers are rejected by integer element compile time assertion for array and... X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=62eb004ccbd4b3d759bda96f7a0c6d072b23ffa9;hp=62eb004ccbd4b3d759bda96f7a0c6d072b23ffa9;p=lttng-ust.git Fix: Pointers are rejected by integer element compile time assertion for array and sequence commit 2df82195d140b ("Add compile time assertion that array and sequence have integer elements") introduced a check to validate that sequences and arrays only contain integers. This was meant to refuse arrays of double/float which are not supported. However, as a side-effect, this also refuses arrays and sequences of pointers, which were accepted prior to lttng-ust 2.13. Introduce a lttng_ust_is_pointer_type() and use it in the array/sequence type validation. The trick here is to use the fact that a difference between two pointers in C is an integer. Therefore, we can validate that an argument type is a pointer similarly to C++ is_pointer. Signed-off-by: Mathieu Desnoyers Fixes: #1355 Change-Id: I7c96d24ab68fb711f85eccdb781a3c513b45c5dc ---