From 927e6efc3d93ff9d34c532180591dc3ca326edf5 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 22 Jan 2017 05:16:05 +0300 Subject: clint: Allow omitting include guards in .c.h file and func_attr.h file --- src/nvim/func_attr.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/nvim/func_attr.h') diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index 18410445e1..7b8fcc4343 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -41,10 +41,6 @@ // $ gcc -E -dM - Date: Sun, 30 Apr 2017 09:16:11 +0200 Subject: api: deprecate obsolete nvim_buf_get_number function --- src/nvim/func_attr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/func_attr.h') diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index 18410445e1..756c6d05ee 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -187,6 +187,7 @@ # define FUNC_API_NOEXPORT # define FUNC_API_NOEVAL # define FUNC_API_SINCE(X) +# define FUNC_API_DEPRECATED_SINCE(X) # define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC # define FUNC_ATTR_ALLOC_SIZE(x) REAL_FATTR_ALLOC_SIZE(x) # define FUNC_ATTR_ALLOC_SIZE_PROD(x, y) REAL_FATTR_ALLOC_SIZE_PROD(x, y) -- cgit From 2d5920ae1ada751811e04bcc8d3a8fe4f890617a Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 10 May 2017 10:29:43 +0200 Subject: api: always use prefix FUNC_API, also change NOEVAL to REMOTE_ONLY --- src/nvim/func_attr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/func_attr.h') diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index 1049b5b7a6..9146a1a8ea 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -181,7 +181,7 @@ #ifdef DEFINE_FUNC_ATTRIBUTES # define FUNC_API_ASYNC # define FUNC_API_NOEXPORT -# define FUNC_API_NOEVAL +# define FUNC_API_REMOTE_ONLY # define FUNC_API_SINCE(X) # define FUNC_API_DEPRECATED_SINCE(X) # define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC -- cgit From 77f8aebf4145485b9ddf9903c4d72bf92792b18a Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 20 Apr 2017 01:10:44 -0400 Subject: func_attr: Support "noreturn" attribute --- src/nvim/func_attr.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/func_attr.h') diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index 9146a1a8ea..cc94a41f80 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -89,6 +89,10 @@ # undef FUNC_ATTR_NONNULL_RET #endif +#ifdef FUNC_ATTR_NORETURN +# undef FUNC_ATTR_NORETURN +#endif + #ifndef DID_REAL_ATTR # define DID_REAL_ATTR # ifdef __GNUC__ @@ -107,6 +111,7 @@ # define REAL_FATTR_UNUSED __attribute__((unused)) # define REAL_FATTR_NONNULL_ALL __attribute__((nonnull)) # define REAL_FATTR_NONNULL_ARG(...) __attribute__((nonnull(__VA_ARGS__))) +# define REAL_FATTR_NORETURN __attribute__((noreturn)) # ifdef __clang__ // clang only @@ -176,6 +181,10 @@ # ifndef REAL_FATTR_NONNULL_RET # define REAL_FATTR_NONNULL_RET # endif + +# ifndef REAL_FATTR_NORETURN +# define REAL_FATTR_NORETURN +# endif #endif #ifdef DEFINE_FUNC_ATTRIBUTES @@ -196,6 +205,7 @@ # define FUNC_ATTR_NONNULL_ALL REAL_FATTR_NONNULL_ALL # define FUNC_ATTR_NONNULL_ARG(...) REAL_FATTR_NONNULL_ARG(__VA_ARGS__) # define FUNC_ATTR_NONNULL_RET REAL_FATTR_NONNULL_RET +# define FUNC_ATTR_NORETURN REAL_FATTR_NORETURN #elif !defined(DO_NOT_DEFINE_EMPTY_ATTRIBUTES) # define FUNC_ATTR_MALLOC # define FUNC_ATTR_ALLOC_SIZE(x) @@ -209,4 +219,5 @@ # define FUNC_ATTR_NONNULL_ALL # define FUNC_ATTR_NONNULL_ARG(...) # define FUNC_ATTR_NONNULL_RET +# define FUNC_ATTR_NORETURN #endif -- cgit From 8d987809328569a3cca293af17ce33236a8c7055 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 12 May 2017 23:08:36 +0200 Subject: func_attr.h: clang 3.7+: REAL_FATTR_NONNULL_RET Closes #1627 --- src/nvim/func_attr.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/nvim/func_attr.h') diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index cc94a41f80..3b9cb3e52e 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -113,16 +113,19 @@ # define REAL_FATTR_NONNULL_ARG(...) __attribute__((nonnull(__VA_ARGS__))) # define REAL_FATTR_NORETURN __attribute__((noreturn)) -# ifdef __clang__ -// clang only +# if defined(__clang__) && __clang__ == 1 +// clang +# if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 7)) +# define REAL_FATTR_NONNULL_RET __attribute__((returns_nonnull)) +# endif # elif defined(__INTEL_COMPILER) -// intel only +// intel compiler # else # define GCC_VERSION \ (__GNUC__ * 10000 + \ __GNUC_MINOR__ * 100 + \ __GNUC_PATCHLEVEL__) -// gcc only +// gcc # define REAL_FATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # define REAL_FATTR_ALLOC_SIZE_PROD(x, y) __attribute__((alloc_size(x, y))) # if GCC_VERSION >= 40900 -- cgit From c77c54f1bc8f2a251d6be35d09fe309d653e671f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 13 May 2017 01:22:53 +0200 Subject: func_attr.h: use NVIM_HAS_ATTRIBUTE --- src/nvim/func_attr.h | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'src/nvim/func_attr.h') diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index 3b9cb3e52e..f1a1d9a563 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -41,6 +41,8 @@ // $ gcc -E -dM - 3 || (__clang_major__ == 3 && __clang_minor__ >= 7)) -# define REAL_FATTR_NONNULL_RET __attribute__((returns_nonnull)) -# endif -# elif defined(__INTEL_COMPILER) -// intel compiler -# else -# define GCC_VERSION \ - (__GNUC__ * 10000 + \ - __GNUC_MINOR__ * 100 + \ - __GNUC_PATCHLEVEL__) -// gcc +# if NVIM_HAS_ATTRIBUTE(returns_nonnull) +# define REAL_FATTR_NONNULL_RET __attribute__((returns_nonnull)) +# endif + +# if NVIM_HAS_ATTRIBUTE(alloc_size) # define REAL_FATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # define REAL_FATTR_ALLOC_SIZE_PROD(x, y) __attribute__((alloc_size(x, y))) -# if GCC_VERSION >= 40900 -# define REAL_FATTR_NONNULL_RET __attribute__((returns_nonnull)) -# endif # endif # endif -// define function attributes that haven't been defined for this specific -// compiler. +// Define attributes that are not defined for this compiler. # ifndef REAL_FATTR_MALLOC # define REAL_FATTR_MALLOC -- cgit From fb2b3f98bbb90c8cebe0d272cb94c4d49789df21 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 6 May 2017 21:26:44 -0400 Subject: func_attr: Allow disabling UBSAN for a function --- src/nvim/func_attr.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/func_attr.h') diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index f1a1d9a563..d2d88924e5 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -95,6 +95,10 @@ # undef FUNC_ATTR_NORETURN #endif +#ifdef FUNC_ATTR_NO_SANITIZE_UNDEFINED +# undef FUNC_ATTR_NO_SANITIZE_UNDEFINED +#endif + #ifndef DID_REAL_ATTR # define DID_REAL_ATTR # ifdef __GNUC__ @@ -122,6 +126,12 @@ # define REAL_FATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # define REAL_FATTR_ALLOC_SIZE_PROD(x, y) __attribute__((alloc_size(x, y))) # endif + +# if NVIM_HAS_ATTRIBUTE(no_sanitize_undefined) +# define REAL_FATTR_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize_undefined)) +# elif NVIM_HAS_ATTRIBUTE(no_sanitize) +# define REAL_FATTR_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined"))) +# endif # endif // Define attributes that are not defined for this compiler. @@ -177,6 +187,10 @@ # ifndef REAL_FATTR_NORETURN # define REAL_FATTR_NORETURN # endif + +# ifndef REAL_FATTR_NO_SANITIZE_UNDEFINED +# define REAL_FATTR_NO_SANITIZE_UNDEFINED +# endif #endif #ifdef DEFINE_FUNC_ATTRIBUTES @@ -198,6 +212,7 @@ # define FUNC_ATTR_NONNULL_ARG(...) REAL_FATTR_NONNULL_ARG(__VA_ARGS__) # define FUNC_ATTR_NONNULL_RET REAL_FATTR_NONNULL_RET # define FUNC_ATTR_NORETURN REAL_FATTR_NORETURN +# define FUNC_ATTR_NO_SANITIZE_UNDEFINED REAL_FATTR_NO_SANITIZE_UNDEFINED #elif !defined(DO_NOT_DEFINE_EMPTY_ATTRIBUTES) # define FUNC_ATTR_MALLOC # define FUNC_ATTR_ALLOC_SIZE(x) @@ -212,4 +227,5 @@ # define FUNC_ATTR_NONNULL_ARG(...) # define FUNC_ATTR_NONNULL_RET # define FUNC_ATTR_NORETURN +# define FUNC_ATTR_NO_SANITIZE_UNDEFINED #endif -- cgit From ca1ba1085a2be1f8963b48c9ccf3936359959924 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 6 Jun 2017 21:35:44 -0400 Subject: lint --- src/nvim/func_attr.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/nvim/func_attr.h') diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index d2d88924e5..bd26205d6d 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -128,9 +128,11 @@ # endif # if NVIM_HAS_ATTRIBUTE(no_sanitize_undefined) -# define REAL_FATTR_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize_undefined)) +# define REAL_FATTR_NO_SANITIZE_UNDEFINED \ + __attribute__((no_sanitize_undefined)) # elif NVIM_HAS_ATTRIBUTE(no_sanitize) -# define REAL_FATTR_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined"))) +# define REAL_FATTR_NO_SANITIZE_UNDEFINED \ + __attribute__((no_sanitize("undefined"))) # endif # endif -- cgit