KVIrc icon indicating copy to clipboard operation
KVIrc copied to clipboard

kvilib/core/KviPointerHas hTable.h:174: possible infinite recursion

Open dcb314 opened this issue 3 years ago • 4 comments

kvilib/core/KviPointerHashTable.h:174:1: warning: all paths through this function will call itself [-Winfinite-recursion]

Source code is

inline bool kvi_hash_key_equal(const KviCString & szKey1, const KviCString & szKey2) { return kvi_hash_key_equal(szKey1.ptr(), szKey2.ptr()); }

dcb314 avatar May 16 '21 19:05 dcb314

Where you get this warning from?

DarthGandalf avatar May 16 '21 19:05 DarthGandalf

clang, a C++ compiler, with flag -Wall.

dcb314 avatar May 16 '21 20:05 dcb314

Doesn't look like that code is called from anywhere

wodim avatar May 16 '21 20:05 wodim

I see other kvi_hash_key_equal functions, but they have an additional bool param; with it, the inner call would choose a different overload. But as is, it looks like recursion yes

DarthGandalf avatar May 16 '21 20:05 DarthGandalf