libyaml icon indicating copy to clipboard operation
libyaml copied to clipboard

unused-value warnings with gcc 10.2.0

Open floitsch opened this issue 4 years ago • 0 comments

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.

floitsch avatar Feb 08 '21 10:02 floitsch