sipa / minisketch

Minisketch: an optimized library for BCH-based set reconciliation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

warning: 'this' pointer is null in fields/clmul_common_impl.h

fanquake opened this issue · comments

Building 4c1d32b with GCC 11 (gcc-11 (Ubuntu 11.1.0-1ubuntu1~21.04) 11.1.0):

In file included from src/fields/clmul_4bytes.cpp:11:
src/fields/clmul_common_impl.h: In instantiation of 'static constexpr I {anonymous}::GenField<I, B, MOD, MUL, F, SQR, SQR2, SQR4, SQR8, SQR16, QRT, T, LOAD, SAVE>::Sqr16(I) [with I = unsigned int; int B = 25; I MOD = 9; I (* MUL)(I, I) = {anonymous}::MulWithClMulReduce<unsigned int, 25, 9>; F = RecLinTrans<unsigned int, 5, 5, 5, 5, 5>; const F* SQR = (& {anonymous}::SQR_TABLE_25); const F* SQR2 = (& {anonymous}::SQR2_TABLE_25); const F* SQR4 = (& {anonymous}::SQR4_TABLE_25); const F* SQR8 = (& {anonymous}::SQR8_TABLE_25); const F* SQR16 = 0; const F* QRT = (& {anonymous}::QRT_TABLE_25); T = IdTrans; const T* LOAD = (& ID_TRANS); const T* SAVE = (& ID_TRANS)]':
src/fields/clmul_common_impl.h:140:46:   required from '{anonymous}::GenField<I, B, MOD, MUL, F, SQR, SQR2, SQR4, SQR8, SQR16, QRT, T, LOAD, SAVE>::Elem {anonymous}::GenField<I, B, MOD, MUL, F, SQR, SQR2, SQR4, SQR8, SQR16, QRT, T, LOAD, SAVE>::Inv({anonymous}::GenField<I, B, MOD, MUL, F, SQR, SQR2, SQR4, SQR8, SQR16, QRT, T, LOAD, SAVE>::Elem) const [with I = unsigned int; int B = 25; I MOD = 9; I (* MUL)(I, I) = {anonymous}::MulWithClMulReduce<unsigned int, 25, 9>; F = RecLinTrans<unsigned int, 5, 5, 5, 5, 5>; const F* SQR = (& {anonymous}::SQR_TABLE_25); const F* SQR2 = (& {anonymous}::SQR2_TABLE_25); const F* SQR4 = (& {anonymous}::SQR4_TABLE_25); const F* SQR8 = (& {anonymous}::SQR8_TABLE_25); const F* SQR16 = 0; const F* QRT = (& {anonymous}::QRT_TABLE_25); T = IdTrans; const T* LOAD = (& ID_TRANS); const T* SAVE = (& ID_TRANS); {anonymous}::GenField<I, B, MOD, MUL, F, SQR, SQR2, SQR4, SQR8, SQR16, QRT, T, LOAD, SAVE>::Elem = unsigned int]'
src/fields/../sketch_impl.h:302:34:   required from 'std::vector<typename F::Elem> BerlekampMassey(const std::vector<typename F::Elem>&, size_t, const F&) [with F = {anonymous}::GenField<unsigned int, 25, 9, {anonymous}::MulWithClMulReduce<unsigned int, 25, 9>, RecLinTrans<unsigned int, 5, 5, 5, 5, 5>, (& {anonymous}::SQR_TABLE_25), (& {anonymous}::SQR2_TABLE_25), (& {anonymous}::SQR4_TABLE_25), (& {anonymous}::SQR8_TABLE_25), 0, (& {anonymous}::QRT_TABLE_25), IdTrans, (& ID_TRANS), (& ID_TRANS)>; typename F::Elem = unsigned int; size_t = long unsigned int]'
src/fields/../sketch_impl.h:397:36:   required from 'int SketchImpl<F>::Decode(int, uint64_t*) const [with F = {anonymous}::GenField<unsigned int, 25, 9, {anonymous}::MulWithClMulReduce<unsigned int, 25, 9>, RecLinTrans<unsigned int, 5, 5, 5, 5, 5>, (& {anonymous}::SQR_TABLE_25), (& {anonymous}::SQR2_TABLE_25), (& {anonymous}::SQR4_TABLE_25), (& {anonymous}::SQR8_TABLE_25), 0, (& {anonymous}::QRT_TABLE_25), IdTrans, (& ID_TRANS), (& ID_TRANS)>; uint64_t = long unsigned int]'
src/fields/../sketch_impl.h:394:9:   required from here
src/fields/clmul_common_impl.h:114:73: warning: 'this' pointer is null [-Wnonnull]
  114 |     static inline constexpr I Sqr16(I a) { return SQR16->template Map<O>(a); }
      |                                                   ~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from src/fields/clmul_common_impl.h:14,
                 from src/fields/clmul_4bytes.cpp:11:
src/fields/../lintrans.h:134:24: note: in a call to non-static member function 'constexpr I RecLinTrans<I, N, X ...>::Map(I) const [with O = BitsInt<unsigned int, 25>; int P = 0; I = unsigned int; int N = 5; int ...X = {5, 5, 5, 5}]'
  134 |     inline I constexpr Map(I a) const { return trans.template Map<O, P>(a) ^ rec.template Map<O, P + N>(a); }

Full output.

I haven't looked into this, but noting it here as if this is going to be integrated into Cores build system, this will likely need to be fixed / suppressed etc.

Hmm, that's annoying. It's correct, but also not actually an issue as this code will never be invoked in situations where a nullptr was passed (it's all compile-time stuff). Let me try to work around it.