Skip to content

value computed is not used error when compiling with gcc 11.4.0 #297

@godmar

Description

@godmar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions