diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2025-10-18 19:06:52 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2025-10-18 19:06:52 +0200 |
commit | 27dae84ed92f1ef0300263091972338d12e78348 (patch) | |
tree | 7c52931f474fafb8a4bd4fd15ca3461c77cdecc2 /lib/attribute.h | |
parent | 4682deeb62247d34de87f8e777f99e2d337fd377 (diff) |
New upstream version 1.4.1upstream/1.4.1upstream
Diffstat (limited to 'lib/attribute.h')
-rw-r--r-- | lib/attribute.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/attribute.h b/lib/attribute.h index 186faa55..c85412d9 100644 --- a/lib/attribute.h +++ b/lib/attribute.h @@ -1,6 +1,6 @@ /* ATTRIBUTE_* macros for using attributes in GCC and similar compilers - Copyright 2020-2024 Free Software Foundation, Inc. + Copyright 2020-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -50,8 +50,9 @@ - In a function declaration/definition with a storage-class specifier: between the storage-class specifier and the return type. - - Or after the parameter list, - ∙ but after ATTRIBUTE_NOTHROW if present. + - Or, in a function declaration: + after the parameter list, + ∙ but after ATTRIBUTE_NOTHROW if present. In other declarations, such as variable declarations: @@ -85,10 +86,10 @@ _GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_LEAF, _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_MAY_ALIAS, _GL_ATTRIBUTE_MAYBE_UNUSED, _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE, _GL_ATTRIBUTE_NONNULL, - _GL_ATTRIBUTE_NONSTRING, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, - _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_REPRODUCIBLE, - _GL_ATTRIBUTE_RETURNS_NONNULL, _GL_ATTRIBUTE_SENTINEL, - _GL_ATTRIBUTE_UNSEQUENCED. */ + _GL_ATTRIBUTE_NONNULL_IF_NONZERO, _GL_ATTRIBUTE_NONSTRING, + _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, _GL_ATTRIBUTE_PURE, + _GL_ATTRIBUTE_REPRODUCIBLE, _GL_ATTRIBUTE_RETURNS_NONNULL, + _GL_ATTRIBUTE_SENTINEL, _GL_ATTRIBUTE_UNSEQUENCED. */ #if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif @@ -170,6 +171,12 @@ /* Applies to: functions. */ #define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args) +/* ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) - Argument NP (a pointer) + must not be NULL if the argument NI (an integer) is != 0. */ +/* Applies to: functions. */ +#define ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (np, ni) + + /* The function's return value is a non-NULL pointer. */ /* Applies to: functions. */ #define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL @@ -257,7 +264,9 @@ because the function need not return exactly once and can depend on state addressed by its arguments.) See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and - <https://stackoverflow.com/questions/76847905/>. */ + <https://stackoverflow.com/questions/76847905/>. + ATTENTION! Efforts are underway to change the meaning of this attribute. + See <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3424.htm>. */ /* Applies to: functions, pointer to functions, function type. */ #define UNSEQUENCED _GL_ATTRIBUTE_UNSEQUENCED @@ -284,7 +293,9 @@ because the function need not return exactly once and can affect state addressed by its arguments.) See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and - <https://stackoverflow.com/questions/76847905/>. */ + <https://stackoverflow.com/questions/76847905/>. + ATTENTION! Efforts are underway to change the meaning of this attribute. + See <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3424.htm>. */ /* Applies to: functions, pointer to functions, function type. */ #define REPRODUCIBLE _GL_ATTRIBUTE_REPRODUCIBLE |