LINT: get the lint target working.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
Angus Salkeld 2010-10-19 22:36:08 +11:00
parent 7b2a0d3767
commit 9d8d6bfdce
8 changed files with 30 additions and 16 deletions

View File

@ -39,10 +39,6 @@ dist_doc_DATA = COPYING INSTALL README TODO
SUBDIRS = include lib docs tests
lint:
$(MAKE) -C lib lint
doxygen:
$(MAKE) -C docs doxygen

View File

@ -58,6 +58,8 @@ AC_PROG_MAKE_SET
AC_CHECK_PROGS([PKGCONFIG], [pkg-config])
AC_CHECK_PROGS([DOXYGEN], [doxygen])
AM_CONDITIONAL(HAVE_DOXYGEN, test -n "${DOXYGEN}")
AC_CHECK_PROGS([SPLINT], [splint])
AM_CONDITIONAL(HAVE_SPLINT, test -n "${SPLINT}")
## local helper functions
@ -210,7 +212,8 @@ AM_CONDITIONAL(HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS,
PACKAGE_FEATURES=""
LINT_FLAGS="-weak -unrecog +posixlib +ignoresigns -fcnuse \
-badflag -D__gnuc_va_list=va_list -D__attribute\(x\)="
-badflag -D__gnuc_va_list=va_list -D__attribute\(x\)= \
-warnposix +matchanyintegral"
# libraries SONAME
SOMAJOR="0"

View File

@ -57,9 +57,11 @@
#include <strings.h>
#endif /* HAVE_STRINGS_H */
#ifndef S_SPLINT_S
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#endif /* S_SPLINT_S */
#ifdef HAVE_ERRNO_H
#include <errno.h>
@ -81,8 +83,10 @@
#include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifndef S_SPLINT_S
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif /* HAVE_SYSLOG_H */
#endif /* S_SPLINT_S */
#endif /* QB_OS_BASE_H_DEFINED */

View File

@ -22,7 +22,9 @@
#define QB_ARRAY_H_DEFINED
#include <stdint.h>
#ifndef S_SPLINT_S
#include <unistd.h>
#endif /* S_SPLINT_S */
#include <qb/qbdefs.h>
/* *INDENT-OFF* */

View File

@ -21,7 +21,9 @@
#define QB_UTIL_H_DEFINED
#include <stdint.h>
#ifndef S_SPLINT_S
#include <unistd.h>
#endif /* S_SPLINT_S */
/**
* @file qbutil.h

View File

@ -22,14 +22,7 @@
#ifndef QB_TLIST_H_DEFINED
#define QB_TLIST_H_DEFINED
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/param.h>
#include <unistd.h>
#include "os_base.h"
#include <qb/qbdefs.h>
#include <qb/qblist.h>

View File

@ -38,9 +38,10 @@ lib_LTLIBRARIES = libqb.la
libqb_la_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
libqb_la_LDFLAGS = -version-info 0:0:0
libqb_la_SOURCES = util.c hdb.c ringbuffer.c ringbuffer_helper.c array.c \
source_to_lint = util.c hdb.c ringbuffer.c ringbuffer_helper.c array.c \
loop.c loop_poll.c loop_timer.c loop_job.c \
ipcc.c ipcs.c ipc_posix_mq.c ipc_sysv_mq.c ipc_shm.c ipc_us.c
libqb_la_SOURCES = $(source_to_lint)
if HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS
libqb_la_SOURCES+=atomic_gcc.c
else
@ -49,3 +50,17 @@ endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libqb.pc
if HAVE_SPLINT
check_SCRIPTS = run_splint.sh
TESTS = $(check_SCRIPTS)
ALL_LINT_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(libqb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) \
$(LINT_FLAGS) -expect 43
run_splint.sh:
echo "$(SPLINT) $(ALL_LINT_FLAGS) $(source_to_lint)" > $@
chmod +x $@
endif

View File

@ -22,8 +22,7 @@
#ifndef QB_IPC_INT_H_DEFINED
#define QB_IPC_INT_H_DEFINED
#include <unistd.h>
#include "config.h"
#include "os_base.h"
#include <dirent.h>
#include <mqueue.h>