aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-07 02:32:50 +0100
committerGitHub <noreply@github.com>2018-02-07 02:32:50 +0100
commit538361955d123d9c93387f7597303c0ef59c6825 (patch)
treeda1fb4713917fd39fe6c3df2b06fc40a8d7ff71e /src
parentb1412dc412e1308806ff65281d3dc29c1ffc7bdf (diff)
downloadrneovim-538361955d123d9c93387f7597303c0ef59c6825.tar.gz
rneovim-538361955d123d9c93387f7597303c0ef59c6825.tar.bz2
rneovim-538361955d123d9c93387f7597303c0ef59c6825.zip
exit: annotate FUNC_ATTR_NORETURN functions #7954 (#7954)
This should fix a particular false positive from clang 5.0.0 scan-build, which thinks that nlua_init() can continue after preserve_exit().
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c2
-rw-r--r--src/nvim/diff.c6
-rw-r--r--src/nvim/main.c3
-rw-r--r--src/nvim/misc1.c11
-rw-r--r--src/nvim/os_unix.c3
5 files changed, 13 insertions, 12 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index e5da5b835b..a86a908492 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -4466,7 +4466,7 @@ do_arg_all (
// leaving an empty tab page when executed locally.
if (keep_tabs && BUFEMPTY() && curbuf->b_nwindows == 1
&& curbuf->b_ffname == NULL && !curbuf->b_changed) {
- use_firstwin = TRUE;
+ use_firstwin = true;
}
for (i = 0; i < count && i < opened_len && !got_int; ++i) {
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index c2ab57a59b..e55cf7bf7e 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -855,7 +855,7 @@ void ex_diffpatch(exarg_T *eap)
{
char_u *buf = NULL;
win_T *old_curwin = curwin;
- char_u *newname = NULL; // name of patched file buffer
+ char_u *newname = NULL; // name of patched file buffer
char_u *esc_name = NULL;
#ifdef UNIX
@@ -886,9 +886,9 @@ void ex_diffpatch(exarg_T *eap)
esc_name = vim_strsave_shellescape(
#ifdef UNIX
- fullname != NULL ? fullname :
+ fullname != NULL ? fullname :
#endif
- eap->arg, true, true);
+ eap->arg, true, true);
if (esc_name == NULL) {
goto theend;
}
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 3402e2bebc..4fd55f1491 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -577,8 +577,9 @@ int main(int argc, char **argv)
return 0;
}
-/* Exit properly */
+/// Exit properly
void getout(int exitval)
+ FUNC_ATTR_NORETURN
{
tabpage_T *tp, *next_tp;
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index a498c7f4da..8bd59b5886 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -2610,13 +2610,12 @@ int match_user(char_u *name)
return result;
}
-/*
- * Preserve files and exit.
- * When called IObuff must contain a message.
- * NOTE: This may be called from deathtrap() in a signal handler, avoid unsafe
- * functions, such as allocating memory.
- */
+/// Preserve files and exit.
+/// @note IObuff must contain a message.
+/// @note This may be called from deadly_signal() in a signal handler, avoid
+/// unsafe functions, such as allocating memory.
void preserve_exit(void)
+ FUNC_ATTR_NORETURN
{
// 'true' when we are sure to exit, e.g., after a deadly signal
static bool really_exiting = false;
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index d7ba675b68..a27fee4e90 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -133,7 +133,8 @@ void mch_free_acl(vim_acl_T aclent)
}
#endif
-void mch_exit(int r) FUNC_ATTR_NORETURN
+void mch_exit(int r)
+ FUNC_ATTR_NORETURN
{
exiting = true;