Open Pascal-Ortiz opened 6 years ago
I found the same exact error and fixed it by pulling the last comma expression out of the list and put it and the beginning of a new statement after a semicolon. will this be patched? maybe I have an old version of the code.
Strange... this is a C project, so it (and examples) must have been tested with a C compiler ?
So the problem is a C-bug only.
It's not a "C bug". This is C code, so this is bug in the code. Were it a C++ project, not compiling with C would be a moot point.
The example provided in the header file itself:
doesn't compile under a C compiler, leading to the following message:
lvalue required as left operand of assignment
I think there is a bug in
kv_a
function in kvec.h. Lines 84-88 are currently:hence
kv_a(type, v, i)
is a comma expression so cannot stand as a left value. I guess you have to remove the outer parenthesis.EDIT In standard C, a comma expression is not a lvalue contrary to C++. So the test file
kvec_test.cc
provided in the test folder compiles correctly. So the problem is a C-bug only.