Revert "util: Add NONNULL macro"
authorRoman Stratiienko <r.stratiienko@gmail.com>
Wed, 20 Sep 2023 21:06:15 +0000 (00:06 +0300)
committerMarge Bot <emma+marge@anholt.net>
Thu, 21 Sep 2023 10:50:34 +0000 (10:50 +0000)
We agreed in [1] not to use it since it has little value,
but making a code less readable.

[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256

This reverts commit 21dcde096f351f83a2df7aa9f42a7276b5454c81.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256>

meson.build
src/util/macros.h

index c877eb8..b9cba64 100644 (file)
@@ -926,7 +926,6 @@ endforeach
 _attributes = [
   'const', 'flatten', 'malloc', 'pure', 'unused', 'warn_unused_result',
   'weak', 'format', 'packed', 'returns_nonnull', 'alias', 'noreturn',
-  'nonnull',
 ]
 foreach a : cc.get_supported_function_attributes(_attributes)
   pre_args += '-DHAVE_FUNC_ATTRIBUTE_@0@'.format(a.to_upper())
index 0bf1dac..bffabfb 100644 (file)
@@ -317,12 +317,6 @@ do {                       \
 #define ASSERTED
 #endif
 
-#ifdef HAVE_FUNC_ATTRIBUTE_NONNULL
-#define NONNULL __attribute__((__nonnull__))
-#else
-#define NONNULL
-#endif
-
 #ifdef HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT
 #define MUST_CHECK __attribute__((warn_unused_result))
 #else