aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-30 15:51:05 +0800
committerGitHub <noreply@github.com>2023-11-30 15:51:05 +0800
commit543e0256c19f397921a332e06b423215fd9aecb5 (patch)
tree5517c44128bc3a0763fc9789565b78c56e49d690 /src/nvim/eval
parent85be914879d49435c3b689efd5f1dae70e81d168 (diff)
downloadrneovim-543e0256c19f397921a332e06b423215fd9aecb5.tar.gz
rneovim-543e0256c19f397921a332e06b423215fd9aecb5.tar.bz2
rneovim-543e0256c19f397921a332e06b423215fd9aecb5.zip
build: don't define FUNC_ATTR_* as empty in headers (#26317)
FUNC_ATTR_* should only be used in .c files with generated headers. Defining FUNC_ATTR_* as empty in headers causes misuses of them to be silently ignored. Instead don't define them by default, and only define them as empty after a .c file has included its generated header.
Diffstat (limited to 'src/nvim/eval')
-rw-r--r--src/nvim/eval/buffer.c1
-rw-r--r--src/nvim/eval/decode.c1
-rw-r--r--src/nvim/eval/encode.h4
-rw-r--r--src/nvim/eval/executor.c3
-rw-r--r--src/nvim/eval/funcs.c1
-rw-r--r--src/nvim/eval/typval.h12
-rw-r--r--src/nvim/eval/userfunc.c1
-rw-r--r--src/nvim/eval/vars.c1
8 files changed, 10 insertions, 14 deletions
diff --git a/src/nvim/eval/buffer.c b/src/nvim/eval/buffer.c
index c60a104381..1f3b92804d 100644
--- a/src/nvim/eval/buffer.c
+++ b/src/nvim/eval/buffer.c
@@ -14,7 +14,6 @@
#include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
-#include "nvim/func_attr.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/memline.h"
diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c
index 03f79fca84..a6407693d7 100644
--- a/src/nvim/eval/decode.c
+++ b/src/nvim/eval/decode.c
@@ -14,7 +14,6 @@
#include "nvim/eval/encode.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
-#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/gettext.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h
index 26a3286f2b..699956d8ac 100644
--- a/src/nvim/eval/encode.h
+++ b/src/nvim/eval/encode.h
@@ -36,9 +36,11 @@ typedef struct {
size_t li_length; ///< Length of the string inside the read item.
} ListReaderState;
+static inline ListReaderState encode_init_lrstate(const list_T *list)
+ REAL_FATTR_NONNULL_ALL;
+
/// Initialize ListReaderState structure
static inline ListReaderState encode_init_lrstate(const list_T *const list)
- FUNC_ATTR_NONNULL_ALL
{
return (ListReaderState) {
.list = list,
diff --git a/src/nvim/eval/executor.c b/src/nvim/eval/executor.c
index dc23fcdc72..b483f5fbef 100644
--- a/src/nvim/eval/executor.c
+++ b/src/nvim/eval/executor.c
@@ -5,7 +5,6 @@
#include "nvim/eval/executor.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
-#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
@@ -15,7 +14,7 @@
#include "nvim/vim_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
-# include "eval/executor.c.generated.h" // IWYU pragma: export
+# include "eval/executor.c.generated.h"
#endif
char *e_list_index_out_of_range_nr
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 13425b21d1..0054c47678 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -58,7 +58,6 @@
#include "nvim/ex_getln.h"
#include "nvim/file_search.h"
#include "nvim/fileio.h"
-#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
#include "nvim/gettext.h"
diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h
index 58f74a9796..efa6017f4b 100644
--- a/src/nvim/eval/typval.h
+++ b/src/nvim/eval/typval.h
@@ -85,6 +85,9 @@ static inline void tv_list_set_lock(list_T *const l, const VarLockStatus lock)
l->lv_lock = lock;
}
+static inline void tv_list_set_copyid(list_T *l, int copyid)
+ REAL_FATTR_NONNULL_ALL;
+
/// Set list copyID
///
/// Does not expect NULL list, be careful.
@@ -92,7 +95,6 @@ static inline void tv_list_set_lock(list_T *const l, const VarLockStatus lock)
/// @param[out] l List to modify.
/// @param[in] copyid New copyID.
static inline void tv_list_set_copyid(list_T *const l, const int copyid)
- FUNC_ATTR_NONNULL_ALL
{
l->lv_copyID = copyid;
}
@@ -442,22 +444,20 @@ static inline bool tv_get_float_chk(const typval_T *const tv, float_T *const ret
}
static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
- REAL_FATTR_NONNULL_ALL REAL_FATTR_NONNULL_RET REAL_FATTR_PURE
- REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_ALWAYS_INLINE
- FUNC_ATTR_NO_SANITIZE_ADDRESS;
+ REAL_FATTR_ALWAYS_INLINE REAL_FATTR_NONNULL_ALL REAL_FATTR_NONNULL_RET
+ REAL_FATTR_NO_SANITIZE_ADDRESS REAL_FATTR_PURE REAL_FATTR_WARN_UNUSED_RESULT;
/// Compute the `DictWatcher` address from a QUEUE node.
///
/// This only exists for .asan-blacklist (ASAN doesn't handle QUEUE_DATA pointer
/// arithmetic).
static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
- FUNC_ATTR_NO_SANITIZE_ADDRESS
{
return QUEUE_DATA(q, DictWatcher, node);
}
static inline bool tv_is_func(typval_T tv)
- FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_CONST;
+ REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_ALWAYS_INLINE REAL_FATTR_CONST;
/// Check whether given typval_T contains a function
///
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 23b3c4e1b2..e0bf30b158 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -23,7 +23,6 @@
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
-#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
#include "nvim/gettext.h"
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c
index 2968f75f4d..670ee39f4b 100644
--- a/src/nvim/eval/vars.c
+++ b/src/nvim/eval/vars.c
@@ -25,7 +25,6 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
-#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"