skvadrik / re2c

Lexer generator for C, C++, Go and Rust.
https://re2c.org
Other
1.07k stars 169 forks source link

src/util/check.h: always use DCHECK(x) argument to avoid warnings #418

Closed trofi closed 1 year ago

trofi commented 1 year ago

Without the change on gcc-13 build warns as:

./src/parse/input.h: In member function 're2c::loc_t re2c::Input::cur_loc() const':
./src/parse/input.h:139:20: warning: unused variable 'p' [-Wunused-variable]
  139 |     const uint8_t* p = cur;
      |                    ^

The change turns DCHECK(x) into a statement that uses x.