I get compile errors in C++ using any Github release from Version 4.3.0 onwards, using demo.cpp from the "Quick Start" section. See below. It is the same errors using both GCC 12.4 (Cygwin) and Visual Studio 2022. Version 4.2.3 and earlier are ok.
There are other errors in Visual Studio but I can work round these. Visual Studio doesn't like the first parentheses from lines like: "return (art_indexed_child_t){0, 0, 0};" The error message is: "a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax". Workaround is to remove the parens: "return art_indexed_child_t{0, 0, 0};"
$ g++ -std=gnu++20 -o demopp demo.cpp
In file included from demo.cpp:3:
roaring.c: In function ‘void roaring::api::extend_containers(roaring64_bitmap_t*)’:
roaring.c:24537:24: error: invalid conversion from ‘void*’ to ‘roaring::internal::container_t**’ {aka ‘roaring::api::container_s**’} [-fpermissive]
24537 | roaring_realloc(r->containers, new_capacity * sizeof(container_t *));
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void*
roaring.c: In function ‘size_t roaring::api::roaring64_bitmap_shrink_to_fit(roaring64_bitmap_t*)’:
roaring.c:25394:40: error: invalid conversion from ‘void*’ to ‘roaring::internal::container_t**’ {aka ‘roaring::api::container_s**’} [-fpermissive]
25394 | r->containers = roaring_realloc(r->containers,
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
| |
| void*
25395 | new_capacity * sizeof(container_t *));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
roaring.c: In function ‘roaring::api::roaring64_bitmap_t* roaring::api::roaring64_bitmap_frozen_view(const char*, size_t)’:
roaring.c:26861:9: error: cannot convert ‘roaring::internal::container_t*’ {aka ‘roaring::api::container_s*’} to ‘roaring::internal::container_t**’ {aka ‘roaring::api::container_s**’} in assignment
26861 | (container_t *)roaring_malloc(r->capacity * sizeof(container_t *));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| roaring::internal::container_t* {aka roaring::api::container_s*}