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

The compiler doesn't tell us when we ignore a return value in C code #114

Closed
briansmith opened this issue Feb 18, 2016 · 1 comment
Closed

Comments

@briansmith
Copy link
Owner

  • We should turn on the strictest "warn about any unused return values" warnings that every compiler (GCC, clang, MSVC) supports. Unfortunately, it seems like in general compilers don't have such a warning.
  • If we can't make compilers warn about ignored return values without annotations, then we should add the annotations. In GCC this is __attribute__((warn_unused_result)). MSVC has one as well; see the documentation about SAL annotations. This should all abstracted using a macro to be defined in crypto/internal.h, named something like OPENSSL_WARN_UNUSED_RESULT.

Notes:

  • There are likely a lot of small changes that are needed. Try to split the changes up into multiple commits.
  • The GCC/clang work can be done separately from the MSVC work.
@briansmith
Copy link
Owner Author

This depends on #113, at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant