2011-01-09 06:57:07 +00:00
|
|
|
/* A C macro for declaring that specific arguments must not be NULL.
|
2021-01-01 09:13:56 +00:00
|
|
|
Copyright (C) 2009-2021 Free Software Foundation, Inc.
|
2011-01-09 06:57:07 +00:00
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU General Public License as published
|
|
|
|
by the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2011-02-10 03:16:11 +00:00
|
|
|
General Public License for more details.
|
2011-01-09 06:57:07 +00:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2017-09-13 09:07:03 +00:00
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
2011-01-09 06:57:07 +00:00
|
|
|
|
|
|
|
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
|
|
|
|
that the values passed as arguments n, ..., m must be non-NULL pointers.
|
|
|
|
n = 1 stands for the first argument, n = 2 for the second argument etc. */
|
|
|
|
#ifndef _GL_ARG_NONNULL
|
Update from Gnulib
This incorporates:
2020-08-11 Use expression statements also on clang
2020-08-10 Use many __attribute__s with clang
2020-08-09 Use attribute __aligned__ with clang
2020-08-09 Use __alignof__ with clang
2020-08-09 ignore-value: Simplify on clang
2020-08-09 Use __typeof__ with clang
2020-08-09 intprops: Fix typo in comment
2020-08-09 Silence warnings from clang 10 with -Wimplicit-fallthrough
2020-08-09 count-one-bits: Use __builtin_popcount{,l,ll} on clang
2020-08-09 string: Fix build error in C++ mode with clang
2020-08-09 Add ability to emit user-defined diagnostics with clang
2020-08-07 alloca: No need to compile alloca.c with clang
2020-08-06 Use __builtin_assume with clang
* lib/alloca.in.h, lib/arg-nonnull.h, lib/c++defs.h, lib/cdefs.h:
* lib/count-one-bits.h, lib/dirent.in.h, lib/ignore-value.h:
* lib/intprops.h, lib/malloca.h, lib/regex_internal.h:
* lib/stdalign.in.h, lib/stddef.in.h, lib/stdio.in.h:
* lib/stdlib.in.h, lib/string.in.h, lib/verify.h, lib/warn-on-use.h:
* m4/gnulib-common.m4, m4/stddef_h.m4, m4/stdint.m4:
Copy from Gnulib.
2020-08-11 17:58:35 +00:00
|
|
|
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
|
2011-01-09 06:57:07 +00:00
|
|
|
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
|
|
|
|
# else
|
|
|
|
# define _GL_ARG_NONNULL(params)
|
|
|
|
# endif
|
|
|
|
#endif
|