]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/mount_zfs/Makefile.am
cppcheck: integrete cppcheck
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 22 Jan 2021 20:54:34 +0000 (12:54 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 27 Jan 2021 00:12:26 +0000 (16:12 -0800)
commit0e6c493fec53c9a7268aaa73d9b99c3717d5d96f
tree5238a1b947d9c5c692c16401a20b1b6cf6dfa8b7
parenta06ba74a1e5f54f03cc59daeb350f456bbe9e91d
cppcheck: integrete cppcheck

In order for cppcheck to perform a proper analysis it needs to be
aware of how the sources are compiled (source files, include
paths/files, extra defines, etc).  All the needed information is
available from the Makefiles and can be leveraged with a generic
cppcheck Makefile target.  So let's add one.

Additional minor changes:

* Removing the cppcheck-suppressions.txt file.  With cppcheck 2.3
  and these changes it appears to no longer be needed.  Some inline
  suppressions were also removed since they appear not to be
  needed.  We can add them back if it turns out they're needed
  for older versions of cppcheck.

* Added the ax_count_cpus m4 macro to detect at configure time how
  many processors are available in order to run multiple cppcheck
  jobs.  This value is also now used as a replacement for nproc
  when executing the kernel interface checks.

* "PHONY =" line moved in to the Rules.am file which is included
  at the top of all Makefile.am's.  This is just convenient becase
  it allows us to use the += syntax to add phony targets.

* One upside of this integration worth mentioning is it now allows
  `make cppcheck` to be run in any directory to check that subtree.

* For the moment, cppcheck is not run against the FreeBSD specific
  kernel sources.  The cppcheck-FreeBSD target will need to be
  implemented and testing on FreeBSD to support this.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11508
42 files changed:
Makefile.am
cmd/Makefile.am
cmd/mount_zfs/Makefile.am
cmd/raidz_test/Makefile.am
cmd/zdb/Makefile.am
cmd/zed/Makefile.am
cmd/zfs/Makefile.am
cmd/zfs_ids_to_path/Makefile.am
cmd/zgenhostid/Makefile.am
cmd/zhack/Makefile.am
cmd/zinject/Makefile.am
cmd/zpool/Makefile.am
cmd/zpool_influxdb/Makefile.am
cmd/zstream/Makefile.am
cmd/ztest/Makefile.am
cmd/zvol_id/Makefile.am
config/CppCheck.am [new file with mode: 0644]
config/Rules.am
config/always-cppcheck.m4 [new file with mode: 0644]
config/ax_count_cpus.m4 [new file with mode: 0644]
config/zfs-build.m4
cppcheck-suppressions.txt [deleted file]
lib/Makefile.am
lib/libavl/Makefile.am
lib/libefi/Makefile.am
lib/libicp/Makefile.am
lib/libnvpair/Makefile.am
lib/libshare/Makefile.am
lib/libspl/Makefile.am
lib/libtpool/Makefile.am
lib/libunicode/Makefile.am
lib/libuutil/Makefile.am
lib/libzfs/Makefile.am
lib/libzfs_core/Makefile.am
lib/libzfsbootenv/Makefile.am
lib/libzpool/Makefile.am
lib/libzstd/Makefile.am
lib/libzutil/Makefile.am
module/Makefile.in
module/lua/ldebug.c
module/lua/ldo.c
module/os/linux/spl/spl-generic.c