Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

vec_insert() problem happens again #13

Open
seanmoore0707 opened this issue Apr 5, 2020 · 0 comments
Open

vec_insert() problem happens again #13

seanmoore0707 opened this issue Apr 5, 2020 · 0 comments

Comments

@seanmoore0707
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant