> From: David Marchand [mailto:david.march...@redhat.com] > Sent: Tuesday, 15 October 2024 14.11 > > For a reason similar to the change on bitops header, hide bitset > implementation relying on experimental API. > > Fixes: 99a1197647d8 ("eal: add bitset type") > > Signed-off-by: David Marchand <david.march...@redhat.com> > --- > lib/eal/include/rte_bitset.h | 123 +++++++++++++++++++++++++++++++++++ > 1 file changed, 123 insertions(+) > > diff --git a/lib/eal/include/rte_bitset.h > b/lib/eal/include/rte_bitset.h > index 74c643a72a..8ae8425fc2 100644 > --- a/lib/eal/include/rte_bitset.h > +++ b/lib/eal/include/rte_bitset.h > @@ -255,7 +255,13 @@ __rte_experimental > static inline bool > rte_bitset_test(const uint64_t *bitset, size_t bit_num) > { > +#ifdef ALLOW_EXPERIMENTAL_API > return __RTE_BITSET_DELEGATE(rte_bit_test, bitset, bit_num); > +#else > + RTE_SET_USED(bitset); > + RTE_SET_USED(bit_num); > + return false; > +#endif > }
This looks wrong! The API is exposed, but does nothing. It is possible to build without ALLOW_EXPERIMENTAL_API; the compiler will emit warnings when using experimental APIs. If those compiler warnings are not handled as errors, the compiled application will be full of bugs.