-
-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Labels
Description
Did you check existing issues?
- I have read all the tree-sitter docs if it relates to using the parser
- I have searched the existing issues of tree-sitter-cpp
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
0.23.4
Describe the bug
While building cvise which imported tree-sitter-cpp 0.23.4, we get the following error when building for openSUSE Tumbleweed aarch64:
[ 29s] [ 15%] Building C object tree-sitter-cpp/CMakeFiles/tree-sitter-cpp.dir/src/scanner.c.o
[ 29s] cd /home/abuild/rpmbuild/BUILD/cvise-2.12.0+git.20251010.334b9acf-build/cvise-2.12.0+git.20251010.334b9acf/build/tree-sitter-cpp && /usr/bin/cc -DHAVE_CONFIG_H -I/home/abuild/rpmbuild/BUILD/cvise-2.12.0+git.20251010.334b9acf-build/cvise-2.12.0+git.20251010.334b9acf/tree-sitter-cpp/src -mbranch-protection=standard -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fuse-ld=mold -Wall -Wextra -Werror -Wno-unused-parameter -Wno-error=maybe-uninitialized -Wno-error=class-memaccess -Wno-error=non-template-friend -Wno-error=deprecated-declarations -O2 -g -DNDEBUG -std=gnu11 -fPIC -MD -MT tree-sitter-cpp/CMakeFiles/tree-sitter-cpp.dir/src/scanner.c.o -MF CMakeFiles/tree-sitter-cpp.dir/src/scanner.c.o.d -o CMakeFiles/tree-sitter-cpp.dir/src/scanner.c.o -c /home/abuild/rpmbuild/BUILD/cvise-2.12.0+git.20251010.334b9acf-build/cvise-2.12.0+git.20251010.334b9acf/tree-sitter-cpp/src/scanner.c
[ 29s] /home/abuild/rpmbuild/BUILD/cvise-2.12.0+git.20251010.334b9acf-build/cvise-2.12.0+git.20251010.334b9acf/tree-sitter-cpp/src/scanner.c: In function ‘scan_raw_string_delimiter’:
[ 29s] /home/abuild/rpmbuild/BUILD/cvise-2.12.0+git.20251010.334b9acf-build/cvise-2.12.0+git.20251010.334b9acf/tree-sitter-cpp/src/scanner.c:32:34: error: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘wchar_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
[ 29s] 32 | if (lexer->lookahead != scanner->delimiter[i]) {
[ 29s] | ^~
[ 29s] /home/abuild/rpmbuild/BUILD/cvise-2.12.0+git.20251010.334b9acf-build/cvise-2.12.0+git.20251010.334b9acf/tree-sitter-cpp/src/scanner.c: In function ‘scan_raw_string_content’:
[ 29s] /home/abuild/rpmbuild/BUILD/cvise-2.12.0+git.20251010.334b9acf-build/cvise-2.12.0+git.20251010.334b9acf/tree-sitter-cpp/src/scanner.c:78:38: error: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘wchar_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
[ 29s] 78 | if (lexer->lookahead == scanner->delimiter[delimiter_index]) {
[ 29s] | ^~
[ 29s] cc1: all warnings being treated as errors
[ 29s] make[2]: *** [tree-sitter-cpp/CMakeFiles/tree-sitter-cpp.dir/build.make:100: tree-sitter-cpp/CMakeFiles/tree-sitter-cpp.dir/src/scanner.c.o] Error 1
Steps To Reproduce/Bad Parse Tree
Build for aarch64 with -Werror=sign-compare
Expected Behavior/Parse Tree
It should build fine.
Repro
// Example code that causes the issue
void foo() {
// Code that fails to parse, or causes an error
}