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:39 +0000 (14:22 -0400)
commitae391697f124e61dca30f67c35adcf2e0e51fc31
tree8209ee81b1b7afa09287a423e484d01998dc2b29
parentcce4cff6e966e6d8f6839dcd448a7fa57a1f51c4
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.026205 seconds and 4 git commands to generate.