RoaringBitmap / CRoaring

Roaring bitmaps in C (and C++), with SIMD (AVX2, AVX-512 and NEON) optimizations: used by Apache Doris, ClickHouse, and StarRocks

Home Page:http://roaringbitmap.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warnings about static mixed with inline

N-Wouda opened this issue · comments

I get some warnings about mixing static/inline functions when compiling CRoaring. This is also the case in your CI build, as a recent CI run shows:

[ 16%] Building C object src/CMakeFiles/roaring.dir/roaring.c.o
In file included from /home/runner/work/CRoaring/CRoaring/include/roaring/roaring.h:15,
                 from /home/runner/work/CRoaring/CRoaring/src/roaring.c:8:
/home/runner/work/CRoaring/CRoaring/include/roaring/bitset/bitset.h:[262](https://github.com/RoaringBitmap/CRoaring/actions/runs/5432305489/jobs/9879249138#step:3:263):21: warning: ‘roaring_trailing_zeroes’ is static but used in inline function ‘bitset_for_each’ which is not static
  262 |             int r = roaring_trailing_zeroes(w);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/CRoaring/CRoaring/include/roaring/bitset/bitset.h:233:21: warning: ‘roaring_trailing_zeroes’ is static but used in inline function ‘bitset_next_set_bits’ which is not static
  233 |             int r = roaring_trailing_zeroes(w);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/CRoaring/CRoaring/include/roaring/bitset/bitset.h:202:27: warning: ‘roaring_trailing_zeroes’ is static but used in inline function ‘bitset_next_set_bit’ which is not static
  202 |             *i = x * 64 + roaring_trailing_zeroes(w);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/CRoaring/CRoaring/include/roaring/bitset/bitset.h:195:15: warning: ‘roaring_trailing_zeroes’ is static but used in inline function ‘bitset_next_set_bit’ which is not static
  195 |         *i += roaring_trailing_zeroes(w);
      |               ^~~~~~~~~~~~~~~~~~~~~~~

What can I do to help get rid of these warnings?

We should be able to remove the static qualifier. I have issued a PR.

Note that this is not a bug. The code works fine.