-
Notifications
You must be signed in to change notification settings - Fork 62
vec_insert() problem happens again #13
Description
Hi, when I use vec_insert(), I meet the problem of "right-hand operand of comma expression has no effect" again, even if I have revised vec.h in the way mentioned in another issue. It shows the following problem:
In file included from src/crawler.c:19:0:
src/crawler.c: In function 'getHTML':
./include/vec.h:54:43: warning: pointer/integer type mismatch in conditional expression
( vec_insert_(vec_unpack_(v), idx) ? -1 :
^
./include/vec.h:54:43: note: in definition of macro 'vec_insert'
( vec_insert_(vec_unpack_(v), idx) ? -1 :
^~
((v)->data[idx] = (val)), (v)->length++, 0 )
./include/vec.h:55:44: warning: right-hand operand of comma expression has no effect [-Wunused-value]
( vec_insert_(vec_unpack_(v), idx) ? -1 :\
((v)->data[idx] = (val)), (v)->length++, 0 )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
src/crawler.c:558:17: note: in expansion of macro 'vec_insert'
vec_insert(url_vec, 0, whole);
^~~~~~~~~~
./include/vec.h:54:43: warning: pointer/integer type mismatch in conditional expression
( vec_insert_(vec_unpack_(v), idx) ? -1 :\
^
./include/vec.h:54:43: note: in definition of macro 'vec_insert'
( vec_insert_(vec_unpack_(v), idx) ? -1 :\
^~
((v)->data[idx] = (val)), (v)->length++, 0 )
./include/vec.h:55:44: warning: right-hand operand of comma expression has no effect [-Wunused-value]
( vec_insert_(vec_unpack_(v), idx) ? -1 :\
((v)->data[idx] = (val)), (v)->length++, 0 )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
src/crawler.c:567:17: note: in expansion of macro 'vec_insert'
vec_insert(url_vec, 0, whole);
^~~~~~~~~~
Please revise the vec.h, thanks