aboutsummaryrefslogtreecommitdiffstats
path: root/ws_attributes.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-10-26 11:24:22 -0700
committerGuy Harris <guy@alum.mit.edu>2017-10-26 18:25:15 +0000
commit985a8f297b5107bdd29df561fce1cfce5c541863 (patch)
tree98b0b95f5112914c5740cedfdd2d47728c8057ed /ws_attributes.h
parent6ddee4aab22a96c444ace755fe33402f65e9f775 (diff)
Move a comment to where it belongs, expand another comment.
Change-Id: I04eff374132cbe4b93271c7a43303db406998bcb Reviewed-on: https://code.wireshark.org/review/24084 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ws_attributes.h')
-rw-r--r--ws_attributes.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/ws_attributes.h b/ws_attributes.h
index 44a3c195cc..569fed44d5 100644
--- a/ws_attributes.h
+++ b/ws_attributes.h
@@ -27,15 +27,6 @@ extern "C" {
#endif /* __cplusplus */
/*
- * If we're running GCC or clang define _U_ to be "__attribute__((unused))"
- * so we can use _U_ to flag unused function parameters and not get warnings
- * about them. Otherwise, define _U_ to be an empty string so that _U_ used
- * to flag an unused function parameters will compile with other compilers.
- *
- * XXX - similar hints for other compilers?
- */
-
-/*
* This was introduced by Clang:
*
* http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute
@@ -148,6 +139,14 @@ extern "C" {
(__HP_aCC >= ((major)*10000 + (minor)*100))
#endif
+/*
+ * If we're running GCC or clang define _U_ to be "__attribute__((unused))"
+ * so we can use _U_ to flag unused function parameters and not get warnings
+ * about them. Otherwise, define _U_ to be an empty string so that _U_ used
+ * to flag an unused function parameters will compile with other compilers.
+ *
+ * XXX - similar hints for other compilers?
+ */
#if defined(__GNUC__)
/* This includes clang */
#define _U_ __attribute__((unused))
@@ -182,7 +181,10 @@ extern "C" {
#define WS_NORETURN
#endif
-/* Hint to the compiler that the function returns a non-null value */
+/*
+ * WS_RETNONNULL, before a function declaration, means "this function
+ * always returns a non-null pointer".
+ */
#if __has_attribute(returns_nonnull) \
|| WS_IS_AT_LEAST_GNUC_VERSION(4,9)
#define WS_RETNONNULL __attribute__((returns_nonnull))