cppcheck: explicitly exclude kernel code from userspace checks
Thus extracting the final shred of utility Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13316
This commit is contained in:
parent
c1851bf081
commit
c982359460
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Default rules for running cppcheck against the user space components.
|
# cppcheck for userspace – nodist_*_SOURCES are kernel code and cppcheck goes crazy on them.
|
||||||
#
|
#
|
||||||
|
|
||||||
PHONY += cppcheck
|
PHONY += cppcheck
|
||||||
|
@ -15,7 +15,7 @@ cppcheck-recursive-%:
|
||||||
|
|
||||||
_CTGT = $(subst cppcheck-for-,,$@)
|
_CTGT = $(subst cppcheck-for-,,$@)
|
||||||
cppcheck-for-%:
|
cppcheck-for-%:
|
||||||
@[ -n "$($(_CTGT)_SOURCES)$(dist_$(_CTGT)_SOURCES)$(nodist_$(_CTGT)_SOURCES)" ]
|
@[ -n "$($(_CTGT)_SOURCES)$(dist_$(_CTGT)_SOURCES)" ]
|
||||||
$(CPPCHECK) -j$(CPU_COUNT) $(CPPCHECKFLAGS) $(patsubst -U%,,$(patsubst -D%,,$(filter-out $(AM_CPPFLAGS_NOCHECK),$(or $($(_CTGT)_CPPFLAGS),$(AM_CPPFLAGS))))) $($(_CTGT)_SOURCES) $(dist_$(_CTGT)_SOURCES) $(nodist_$(_CTGT)_SOURCES)
|
$(CPPCHECK) -j$(CPU_COUNT) $(CPPCHECKFLAGS) $(patsubst -U%,,$(patsubst -D%,,$(filter-out $(AM_CPPFLAGS_NOCHECK),$(or $($(_CTGT)_CPPFLAGS),$(AM_CPPFLAGS))))) $($(_CTGT)_SOURCES) $(dist_$(_CTGT)_SOURCES)
|
||||||
|
|
||||||
cppcheck: $(addprefix cppcheck-for-,$(subst -,_,$(subst .,_,$(subst /,_,$(CPPCHECKTARGETS))))) $(addprefix cppcheck-recursive-,$(CPPCHECKDIRS))
|
cppcheck: $(addprefix cppcheck-for-,$(subst -,_,$(subst .,_,$(subst /,_,$(CPPCHECKTARGETS))))) $(addprefix cppcheck-recursive-,$(CPPCHECKDIRS))
|
||||||
|
|
|
@ -2,7 +2,6 @@ libavl_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) $(LIBRARY_CFLAGS)
|
||||||
libavl_la_CFLAGS += -fvisibility=hidden
|
libavl_la_CFLAGS += -fvisibility=hidden
|
||||||
|
|
||||||
noinst_LTLIBRARIES += libavl.la
|
noinst_LTLIBRARIES += libavl.la
|
||||||
CPPCHECKTARGETS += libavl.la
|
|
||||||
|
|
||||||
nodist_libavl_la_SOURCES = \
|
nodist_libavl_la_SOURCES = \
|
||||||
module/avl/avl.c
|
module/avl/avl.c
|
||||||
|
|
|
@ -2,7 +2,6 @@ libicp_la_CCASFLAGS = $(AM_CCASFLAGS)
|
||||||
libicp_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) $(LIBRARY_CFLAGS)
|
libicp_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) $(LIBRARY_CFLAGS)
|
||||||
|
|
||||||
noinst_LTLIBRARIES += libicp.la
|
noinst_LTLIBRARIES += libicp.la
|
||||||
CPPCHECKTARGETS += libicp.la
|
|
||||||
|
|
||||||
nodist_libicp_la_SOURCES = \
|
nodist_libicp_la_SOURCES = \
|
||||||
module/icp/spi/kcf_spi.c \
|
module/icp/spi/kcf_spi.c \
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
libunicode_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) $(LIBRARY_CFLAGS)
|
libunicode_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) $(LIBRARY_CFLAGS)
|
||||||
|
|
||||||
noinst_LTLIBRARIES += libunicode.la
|
noinst_LTLIBRARIES += libunicode.la
|
||||||
CPPCHECKTARGETS += libunicode.la
|
|
||||||
|
|
||||||
nodist_libunicode_la_SOURCES = \
|
nodist_libunicode_la_SOURCES = \
|
||||||
module/unicode/u8_textprep.c \
|
module/unicode/u8_textprep.c \
|
||||||
|
|
|
@ -4,7 +4,6 @@ libzstd_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS)
|
||||||
libzstd_la_CFLAGS += -fno-tree-vectorize
|
libzstd_la_CFLAGS += -fno-tree-vectorize
|
||||||
|
|
||||||
noinst_LTLIBRARIES += libzstd.la
|
noinst_LTLIBRARIES += libzstd.la
|
||||||
CPPCHECKTARGETS += libzstd.la
|
|
||||||
|
|
||||||
nodist_libzstd_la_SOURCES = \
|
nodist_libzstd_la_SOURCES = \
|
||||||
module/zstd/lib/common/entropy_common.c \
|
module/zstd/lib/common/entropy_common.c \
|
||||||
|
|
Loading…
Reference in New Issue