vec icon indicating copy to clipboard operation
vec copied to clipboard

vec_insert() problem happens again

Open seanmoore0707 opened this issue 5 years ago • 0 comments

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

seanmoore0707 avatar Apr 05 '20 11:04 seanmoore0707