summaryrefslogtreecommitdiff
path: root/src/message.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-19 21:34:05 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-19 21:34:05 +0100
commit0d8562a9992e94d532485c37268ca33c0c49ecc2 (patch)
treea91ad1f6f9aef842d1a9cfaa2c8e604de9dce3ce /src/message.c
parentc9629251a634d4f5988c8162ba8249026d1af687 (diff)
downloadvim-git-0d8562a9992e94d532485c37268ca33c0c49ecc2.tar.gz
patch 8.1.0954: arguments of semsg() and siemsg() are not checkedv8.1.0954
Problem: Arguments of semsg() and siemsg() are not checked. Solution: Add function prototype with __attribute__.
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/message.c b/src/message.c
index 621edb970..a7aca2b99 100644
--- a/src/message.c
+++ b/src/message.c
@@ -730,6 +730,7 @@ emsg(char *s)
return TRUE; /* no error messages at the moment */
}
+#ifndef PROTO // manual proto with __attribute__
/*
* Print an error message with format string and variable arguments.
* Note: caller must not pass 'IObuff' as 1st argument.
@@ -749,6 +750,7 @@ semsg(const char *s, ...)
}
return TRUE; /* no error messages at the moment */
}
+#endif
/*
* Same as emsg(...), but abort on error when ABORT_ON_INTERNAL_ERROR is
@@ -765,6 +767,7 @@ iemsg(char *s)
#endif
}
+#ifndef PROTO // manual proto with __attribute__
/*
* Same as semsg(...) but abort on error when ABORT_ON_INTERNAL_ERROR is
* defined. It is used for internal errors only, so that they can be
@@ -783,10 +786,11 @@ siemsg(const char *s, ...)
va_end(ap);
emsg_core(IObuff);
}
-#ifdef ABORT_ON_INTERNAL_ERROR
+# ifdef ABORT_ON_INTERNAL_ERROR
abort();
-#endif
+# endif
}
+#endif
/*
* Give an "Internal error" message.