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

vec_insert() problem happens again #13

@seanmoore0707

Description

@seanmoore0707

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions