Skip to content

unused-value warnings with gcc 10.2.0 #210

@floitsch

Description

@floitsch

I'm getting the following warnings when compiling libyaml with gcc 10.2.0:

../../src/compiler/third_party/libyaml/src/emitter.c: In function ‘yaml_emitter_write_plain_scalar’:
../../src/compiler/third_party/libyaml/src/emitter.c:28:6: error: value computed is not used [-Werror=unused-value]
   28 |      && ((emitter->line_break == YAML_CR_BREAK ?                                \
      |      ^~
../../src/compiler/third_party/libyaml/src/emitter.c:56:11: note: in expansion of macro ‘PUT_BREAK’
   56 |          (PUT_BREAK(emitter),                                                   \
      |           ^~~~~~~~~
../../src/compiler/third_party/libyaml/src/emitter.c:1962:18: note: in expansion of macro ‘WRITE_BREAK’
 1962 |             if (!WRITE_BREAK(emitter, string)) return 0;
      |                  ^~~~~~~~~~~
../../src/compiler/third_party/libyaml/src/emitter.c: In function ‘yaml_emitter_write_single_quoted_scalar’:
../../src/compiler/third_party/libyaml/src/emitter.c:28:6: error: value computed is not used [-Werror=unused-value]
   28 |      && ((emitter->line_break == YAML_CR_BREAK ?                                \
      |      ^~
../../src/compiler/third_party/libyaml/src/emitter.c:56:11: note: in expansion of macro ‘PUT_BREAK’
   56 |          (PUT_BREAK(emitter),                                                   \
      |           ^~~~~~~~~
../../src/compiler/third_party/libyaml/src/emitter.c:2019:18: note: in expansion of macro ‘WRITE_BREAK’
 2019 |             if (!WRITE_BREAK(emitter, string)) return 0;
      |                  ^~~~~~~~~~~
../../src/compiler/third_party/libyaml/src/emitter.c: In function ‘yaml_emitter_write_literal_scalar’:
../../src/compiler/third_party/libyaml/src/emitter.c:28:6: error: value computed is not used [-Werror=unused-value]
   28 |      && ((emitter->line_break == YAML_CR_BREAK ?                                \
      |      ^~
../../src/compiler/third_party/libyaml/src/emitter.c:56:11: note: in expansion of macro ‘PUT_BREAK’
   56 |          (PUT_BREAK(emitter),                                                   \
      |           ^~~~~~~~~
../../src/compiler/third_party/libyaml/src/emitter.c:2285:18: note: in expansion of macro ‘WRITE_BREAK’
 2285 |             if (!WRITE_BREAK(emitter, string)) return 0;
      |                  ^~~~~~~~~~~
../../src/compiler/third_party/libyaml/src/emitter.c: In function ‘yaml_emitter_write_folded_scalar’:
../../src/compiler/third_party/libyaml/src/emitter.c:28:6: error: value computed is not used [-Werror=unused-value]
   28 |      && ((emitter->line_break == YAML_CR_BREAK ?                                \
      |      ^~
../../src/compiler/third_party/libyaml/src/emitter.c:56:11: note: in expansion of macro ‘PUT_BREAK’
   56 |          (PUT_BREAK(emitter),                                                   \
      |           ^~~~~~~~~
../../src/compiler/third_party/libyaml/src/emitter.c:2334:18: note: in expansion of macro ‘WRITE_BREAK’
 2334 |             if (!WRITE_BREAK(emitter, string)) return 0;
      |                  ^~~~~~~~~~~
../../src/compiler/third_party/libyaml/src/emitter.c: At top level:

Probably enough to put a (void) into the right places, but I haven't really investigated.

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