Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unused-value warnings with gcc 10.2.0 #210

Open
floitsch opened this issue Feb 8, 2021 · 0 comments · May be fixed by #272
Open

unused-value warnings with gcc 10.2.0 #210

floitsch opened this issue Feb 8, 2021 · 0 comments · May be fixed by #272

Comments

@floitsch
Copy link

floitsch commented Feb 8, 2021

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.

hcindyl added a commit to hcindyl/libyaml that referenced this issue Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant