[ovs-dev] [PATCH] ctags: include symbols with locking annotations.

Flavio Leitner fbl at redhat.com
Tue Jun 27 00:55:50 UTC 2017


OVS uses extensively clang annotations for thread safety
checks. The ctags tool can't parse them, so they are not
included in the tag file.

This patch improves the configure script to generate a list
of identifiers from the header compiler.h to be ignored by
ctags.

Signed-off-by: Flavio Leitner <fbl at redhat.com>
---
 Makefile.am  | 2 ++
 acinclude.m4 | 8 ++++++++
 configure.ac | 1 +
 3 files changed, 11 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index d810a5e..1c4dc3e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,6 +42,8 @@ AM_CPPFLAGS += -DNDEBUG
 AM_CFLAGS += -fomit-frame-pointer
 endif
 
+AM_CTAGSFLAGS = $(OVS_CTAGS_IDENTIFIERS_LIST)
+
 if WIN32
 psep=";"
 else
diff --git a/acinclude.m4 b/acinclude.m4
index 7d7b683..4fc8190 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -952,6 +952,14 @@ AC_DEFUN([OVS_ENABLE_SPARSE],
    AC_CONFIG_COMMANDS_PRE(
      [CC='$(if $(C),env REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I $(top_srcdir)/include/sparse $(SPARSEFLAGS) $(SPARSE_EXTRA_INCLUDES) " cgcc $(CGCCFLAGS),'"$CC"')'])])
 
+dnl OVS_CTAGS_IDENTIFIERS
+dnl
+dnl ctags ignores symbols with extras identifiers. This builds a list of
+dnl specially handled identifiers to be ignored.
+AC_DEFUN([OVS_CTAGS_IDENTIFIERS],
+    AC_SUBST([OVS_CTAGS_IDENTIFIERS_LIST],
+           [`echo -n '-I "'; sed -n 's/^#define \(OVS_[A-Z_]\+\)(\.\.\.)$/\1+/p' ${srcdir}/include/openvswitch/compiler.h  | tr \\\n ' ' ; echo -n '"'`] ))
+
 dnl OVS_PTHREAD_SET_NAME
 dnl
 dnl This checks for three known variants of pthreads functions for setting
diff --git a/configure.ac b/configure.ac
index 6404b5f..058c954 100644
--- a/configure.ac
+++ b/configure.ac
@@ -170,6 +170,7 @@ OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
 OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
 OVS_ENABLE_WERROR
 OVS_ENABLE_SPARSE
+OVS_CTAGS_IDENTIFIERS
 
 AC_ARG_VAR(KARCH, [Kernel Architecture String])
 AC_SUBST(KARCH)
-- 
2.9.4



More information about the dev mailing list