aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/generators/gen_declarations.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-12-11 02:21:39 -0800
committerGitHub <noreply@github.com>2019-12-11 02:21:39 -0800
commit3383f1ce26eddcd0311f5b5ab340cf101b704ec6 (patch)
tree0eb9228b1fbdab27d47c96cfaefb8eebc2c397a4 /src/nvim/generators/gen_declarations.lua
parent39094b3faedde9601160806901941e4808925410 (diff)
downloadrneovim-3383f1ce26eddcd0311f5b5ab340cf101b704ec6.tar.gz
rneovim-3383f1ce26eddcd0311f5b5ab340cf101b704ec6.tar.bz2
rneovim-3383f1ce26eddcd0311f5b5ab340cf101b704ec6.zip
PVS/V1049: fix numerous "DEFINE_FUNC_ATTRIBUTES" warnings #11544
PVS erroneously flags our DEFINE_FUNC_ATTRIBUTES guard: V1049 The 'DEFINE_FUNC_ATTRIBUTES' include guard is already defined in the 'lang.h.generated.h' header. The 'profile.h.generated.h' header will be excluded from compilation. To satisfy PVS, just remove the `#ifndef` check. It's not needed anyway: C allows to redundantly #define a macro. https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html > if an identifier which is currently a macro is redefined, then the new > definition must be effectively the same as the old one > ... > If a macro is redefined with a definition that is not effectively the > same as the old one, the preprocessor issues a warning and changes the > macro to use the new definition. If the new definition is effectively > the same, the redefinition is silently ignored. This allows, for > instance, two different headers to define a common macro. The > preprocessor will only complain if the definitions do not match.
Diffstat (limited to 'src/nvim/generators/gen_declarations.lua')
-rwxr-xr-xsrc/nvim/generators/gen_declarations.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/generators/gen_declarations.lua b/src/nvim/generators/gen_declarations.lua
index ad44613f42..0782c8115d 100755
--- a/src/nvim/generators/gen_declarations.lua
+++ b/src/nvim/generators/gen_declarations.lua
@@ -207,9 +207,7 @@ preproc_f:close()
local header = [[
-#ifndef DEFINE_FUNC_ATTRIBUTES
-# define DEFINE_FUNC_ATTRIBUTES
-#endif
+#define DEFINE_FUNC_ATTRIBUTES
#include "nvim/func_attr.h"
#undef DEFINE_FUNC_ATTRIBUTES
]]