Fix: Pointers are rejected by integer element compile time assertion for array and...
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 20 May 2022 16:00:08 +0000 (12:00 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 20 May 2022 18:22:26 +0000 (14:22 -0400)
commit62eb004ccbd4b3d759bda96f7a0c6d072b23ffa9
tree1c24dd8a0c19bcee81dc05c324f92967010c9de6
parent2ebb27909ba460be6b58e24750e1cd55b12729df
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 <mathieu.desnoyers@efficios.com>
Fixes: #1355
Change-Id: I7c96d24ab68fb711f85eccdb781a3c513b45c5dc
include/lttng/ust-utils.h
tests/unit/ust-utils/ust-utils-common.h
This page took 0.02565 seconds and 4 git commands to generate.