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

fix unimportant "warn_unused_result" warnings #1664

Closed
markus2330 opened this Issue Oct 29, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@markus2330
Contributor

markus2330 commented Oct 29, 2017

We need some infrastructure to tag places where we do not care about return values (e.g. benchmarks). I found following warnings:

src/bindings/intercept/env/benchmarks/benchmark_getenv.cpp: In function ‘void benchmark_getenv()’:
src/bindings/intercept/env/benchmarks/benchmark_getenv.cpp:67:19: warning: ignoring return value of ‘char* getenv(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
   getenv ("HELLO");
                   ^

src/plugins/keytometa/testmod_keytometa.c: In function ‘createMergingKey’:
/home/markus/Projekte/Elektra/build-64/tmpbuilddir/libelektra/src/plugins/keytometa/testmod_keytometa.c:34:2: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
  asprintf (&name, "user/convertkey%d", i);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/plugins/keytometa/testmod_keytometa.c:35:2: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
  asprintf (&value, "meta line %d", i);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/plugins/keytometa/testmod_keytometa.c:36:2: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
  asprintf (&order, "%i", i);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment