tree-sitter-bash icon indicating copy to clipboard operation
tree-sitter-bash copied to clipboard

`value computed is not used` error when compiling with gcc 11.4.0

Open godmar opened this issue 6 months ago • 0 comments

See subject. This code in scanner.c won't compile. See also here. Compiles with clang 14.

tree-sitter-bash/src$ gcc -Werror -Wall -c scanner.c 
In file included from scanner.c:1:
scanner.c: In function ‘scan_heredoc_content’:
tree_sitter/array.h:107:42: error: value computed is not used [-Werror=unused-value]
  107 | #define array_pop(self) ((self)->contents[--(self)->size])
      |                         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
scanner.c:309:25: note: in expansion of macro ‘array_pop’
  309 |                         array_pop(&scanner->heredocs);
      |                         ^~~~~~~~~
scanner.c: In function ‘scan’:
tree_sitter/array.h:107:42: error: value computed is not used [-Werror=unused-value]
  107 | #define array_pop(self) ((self)->contents[--(self)->size])
      |                         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
scanner.c:448:13: note: in expansion of macro ‘array_pop’
  448 |             array_pop(&scanner->heredocs);
      |             ^~~~~~~~~
cc1: all warnings being treated as errors

godmar avatar Jul 10 '25 03:07 godmar