diff --git a/configure.ac b/configure.ac index 3ccb70d45..dacc7e5ac 100644 --- a/configure.ac +++ b/configure.ac @@ -409,9 +409,10 @@ if test x"$memory_barrier_needed" != xno; then [need atomic memory barrier]) fi -LINT_FLAGS="-syntax -weak -unrecog +posixlib +ignoresigns -fcnuse \ - -badflag -D__gnuc_va_list=va_list -D__attribute\(x\)= \ - -warnposix +matchanyintegral -sysunrecog" +LINT_FLAGS="-weak -D__gnuc_va_list=va_list -D__attribute\(x\)= \ + -badflag -fcnuse -syntax -unrecog -sysunrecog -warnposix \ + +ignoresigns +matchanyintegral +posixlib \ + +showscan +showsummary" # local options AC_ARG_ENABLE([ansi], diff --git a/include/qb/qblog.h b/include/qb/qblog.h index ff2c43f3a..408465b4b 100644 --- a/include/qb/qblog.h +++ b/include/qb/qblog.h @@ -564,8 +564,13 @@ typedef union { int32_t qb_log_ctl2(int32_t target, enum qb_log_conf conf_type, qb_log_ctl2_arg_t arg); +# ifndef S_SPLINT_S #define QB_LOG_CTL2_I32(a) ((qb_log_ctl2_arg_t) { .i32 = (a) }) #define QB_LOG_CTL2_S(a) ((qb_log_ctl2_arg_t) { .s = (a) }) +#else +#define QB_LOG_CTL2_I32(a) ((qb_log_ctl2_arg_t)(a)) +#define QB_LOG_CTL2_S(a) ((qb_log_ctl2_arg_t)(a)) +#endif /** * This allows you modify the 'tags' and 'targets' callsite fields at runtime. diff --git a/lib/Makefile.am b/lib/Makefile.am index 371cc002c..10720a8a3 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -73,10 +73,23 @@ DEB_INCLUDES = -I/usr/include/x86_64-linux-gnu -I/usr/include/i386-linux-gnu ALL_LINT_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(DEB_INCLUDES) \ $(libqb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CPPFLAGS) \ $(LINT_FLAGS) +# expected for the time being (but SHOULD be fixed eventually): +# ipc_setup.c: (in function qb_ipcc_us_setup_connect) +# ipc_setup.c:479:2: Return value (type int32_t) ignored: qb_ipc_us_ready(... +# ipc_setup.c:494:2: Return value (type int32_t) ignored: qb_ipc_auth_cred... +SPLINT_SUMMARY_EXP = " 2 code warnings" run_splint.sh: $(top_srcdir)/configure.ac - @echo "$(SPLINT) $(ALL_LINT_FLAGS) $(addprefix $(top_srcdir)/lib/, $(source_to_lint))" > $@ - $(AM_V_GEN)chmod +x $@ + @echo '$(SPLINT) $(ALL_LINT_FLAGS) \' > $@-t + @echo ' $(addprefix $(top_srcdir)/lib/, $(source_to_lint)) \' >> $@-t + @echo ' 2>&1 | tee $@-o' >> $@-t + @echo 'tail -n1 $@-o | grep -qF $(SPLINT_SUMMARY_EXP)' >> $@-t + @echo 'ret=$$?' >> $@-t + @echo 'rm -f $@-o' >> $@-t + @echo 'test $$ret = 0 || echo "EXPECTED:$(SPLINT_SUMMARY_EXP)"' >> $@-t + @echo 'exit $$ret' >> $@-t + @chmod +x $@-t + $(AM_V_GEN)mv $@-t $@ dist-clean-local: rm -f run_splint.sh diff --git a/lib/loop_poll.c b/lib/loop_poll.c index 117a27646..5c757481b 100644 --- a/lib/loop_poll.c +++ b/lib/loop_poll.c @@ -20,7 +20,8 @@ */ #include "os_base.h" -#ifdef HAVE_SYS_RESOURCE_H +/* due to MinGW/splint emitting "< Location unknown >: Previous use of" */ +#if defined(HAVE_SYS_RESOURCE_H) && !defined(S_SPLINT_S) #include #endif