mirror of
https://gitlab.freedesktop.org/xorg/proto/xorgproto.git
synced 2026-05-08 10:08:03 +02:00
Add _X_NONNULL macro to annotate when a function expects arguments to be non-null
This will allow with compiler optimization and better static analysis. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
6648db8f91
commit
217d1dae00
1 changed files with 6 additions and 0 deletions
|
|
@ -122,6 +122,12 @@ in this Software without prior written authorization from The Open Group.
|
|||
# define _X_ATTRIBUTE_PRINTF(x,y)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
|
||||
#define _X_NONNULL(args...) __attribute__((nonnull(args)))
|
||||
#else
|
||||
#define _X_NONNULL(...) /* */
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
|
||||
#define _X_UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue