bitcoin/secp256k1 — pull request #101 by gmaxwell (2014-11-12 20:07:38+00:00)
Title: Add non-null and unused-result warnings for the external API.

GCC (and clang) supports extensions to annotate functions so that their
results must be used and so that their arguments can't be statically
provable to be null. If a caller violates these requirements they
get a warning, so this helps them write correct code.

I deployed this in libopus a couple years ago with good success, and
the implementation here is basically copied straight from that.

One consideration is that the non-null annotation teaches the optimizer
and will actually compile out runtime non-nullness checks as dead-code.
Since this is usually not whats wanted, the non-null annotations are
disabled when compiling the library itself.

The commit also removes some dead inclusions of assert.h and introduces
compatibility macros for restrict and inline in preparation for some
portability improvements.