compiler: Provide LIBPLDM_CC_NONNULL{,_ARGS()}

This allows us to elide checks where they're not necessary, and warn
people at compile-time when they're doing things they shouldn't.

Note that this comes with an apparent ABI break. abi-compliance-checker
reports:

```
platform.h, libpldm.so.0.8.0
[−] decode_sensor_op_data ( uint8_t const* sensor_data, size_t sensor_data_length, uint8_t* present_op_state, uint8_t* previous_op_state )
Change: The parameter previous_op_state became passed in r8 register instead of rcx.
Effect Applications will read the wrong memory block instead of the parameter value.
```

It's unclear to me why. The signature hasn't changed, but how the
implementation tests the parameter values has.

Change-Id: Ie8d8bc1641280522532d9b4764bf07c64b1921c8
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/compiler.h b/src/compiler.h
index af392b1..91b6e24 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -11,6 +11,8 @@
 static struct {
 	static_assert(__has_attribute(always_inline),
 		      "`always_inline` attribute is required");
+	static_assert(__has_attribute(nonnull),
+		      "`nonnull` attribute is required");
 	static_assert(__has_attribute(unused),
 		      "`unused` attribute is required");
 	static_assert(__has_attribute(warn_unused_result),
@@ -19,6 +21,8 @@
 } pldm_required_attributes __attribute__((unused));
 
 #define LIBPLDM_CC_ALWAYS_INLINE      __attribute__((always_inline)) static inline
+#define LIBPLDM_CC_NONNULL	      __attribute__((nonnull))
+#define LIBPLDM_CC_NONNULL_ARGS(...)  __attribute__((nonnull(__VA_ARGS__)))
 #define LIBPLDM_CC_UNUSED	      __attribute__((unused))
 #define LIBPLDM_CC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))