зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1365928 - patch 1 - Add a MOZ_NONNULL_RETURN annotation to mfbt/Attributes.h. r=froydnj
This commit is contained in:
Родитель
a7aee158a9
Коммит
67ca6e1f88
|
@ -147,6 +147,21 @@
|
||||||
# define MOZ_NONNULL(...)
|
# define MOZ_NONNULL(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MOZ_NONNULL_RETURN tells the compiler that the function's return value is
|
||||||
|
* guaranteed to be a non-null pointer, which may enable the compiler to
|
||||||
|
* optimize better at call sites.
|
||||||
|
*
|
||||||
|
* Place this attribute at the end of a function declaration. For example,
|
||||||
|
*
|
||||||
|
* char* foo(char *p, char *q) MOZ_NONNULL_RETURN;
|
||||||
|
*/
|
||||||
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
|
# define MOZ_NONNULL_RETURN __attribute__ ((returns_nonnull))
|
||||||
|
#else
|
||||||
|
# define MOZ_NONNULL_RETURN
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS, specified at the end of a function
|
* MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS, specified at the end of a function
|
||||||
* declaration, indicates that for the purposes of static analysis, this
|
* declaration, indicates that for the purposes of static analysis, this
|
||||||
|
|
Загрузка…
Ссылка в новой задаче