Build warning: control reaches end of non-void function
Closed this issue · 5 comments
Xuanwo commented
While building with rust, we will meat warnings like:
warning: vendor/tree-sitter-perl-src/scanner.cc: In member function ‘bool {anonymous}::Scanner::handle_escape_sequence(TSLexer*, {anonymous}::TokenType)’:
warning: vendor/tree-sitter-perl-src/scanner.cc:537:5: warning: control reaches end of non-void function [-Wreturn-type]
warning: 537 | }
warning: | ^
Adding a return false
looks good to you? I'm glad to send a PR for it.
ganezdragon commented
@Xuanwo , could you tell me what's the step to build using rust? I can quickly check that out.
Xuanwo commented
It can be reproduced by:
:) cc -Werror -I ./src -c src/scanner.cc
src/scanner.cc: In member function ‘bool {anonymous}::Scanner::handle_escape_sequence(TSLexer*, {anonymous}::TokenType)’:
src/scanner.cc:537:5: error: control reaches end of non-void function [-Werror=return-type]
537 | }
| ^
cc1plus: all warnings being treated as errors
Xuanwo commented
@ganezdragon Hi, any updates on this issue?
ganezdragon commented
Xuanwo commented
Thanks a lot!