Bug #84
closedcoherency between const and non-const parameters
0%
Description
The get_field and get_field_list functions return const pointers, but the functions to extract the data from these fields (get_uint64 and others) don't specify a const pointer as argument, which produces a warning when using the library.
Added by Julien Desfossez almost 13 years ago
Added by Simon Marchi 8 months ago
span-lite: backport fix to avoid -Wundef error in C++20
When building babeltrace as C++20, I get:
CXX clock-correlation-validator/clock-correlation-validator.lo
In file included from /home/smarchi/src/babeltrace/src/cpp-common/bt2s/span.hpp:18,
from /home/smarchi/src/babeltrace/src/cpp-common/bt2c/logging.hpp:25,
from /home/smarchi/src/babeltrace/src/cpp-common/bt2/component-class-dev.hpp:15,
from /home/smarchi/src/babeltrace/src/cpp-common/bt2/component-class.hpp:15,
from /home/smarchi/src/babeltrace/src/cpp-common/bt2/error.hpp:20,
from /home/smarchi/src/babeltrace/src/cpp-common/bt2/wrap.hpp:15,
from /home/smarchi/src/babeltrace/src/clock-correlation-validator/clock-correlation-validator.cpp:9:
/home/smarchi/src/babeltrace/src/cpp-common/vendor/span-lite/span.hpp:43:33: error: "span_HAVE_STRUCT_BINDING" is not defined, evaluates to 0 [-Werror=undef]
43 | #define span_HAVE( feature ) ( span_HAVE_##feature )
| ^~~~~~~~
/home/smarchi/src/babeltrace/src/cpp-common/vendor/span-lite/span.hpp:1873:5: note: in expansion of macro 'span_HAVE'
1873 | #if span_HAVE( STRUCT_BINDING )
| ^~~~~~~
Backport commit b8921715cd71 ("Guard section for tuple interface to only
use with nonstd::span; fixes #84 (thanks @simark)") from the upstream
repo [1]
[1] https://github.com/martinmoene/span-lite/commit/b8921715cd71997bdab120a8ced526b78d300196
Change-Id: I84b21f8157f7bf44e02e67789cfa1fee2a38da05
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12525
Fix : coherency in const parameters
This patchs adds the const attribute to the field access functions
(get_int64 and others) in order to keep the coherency with the get_field
and get_field_list function which return a const pointer.
fixes #84
Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>