Edit HACKING: cppcheck v1.58

This commit is contained in:
Philippe Teuwen 2013-03-06 10:54:54 +01:00
parent 9632f3ef35
commit f152aaffa3

41
HACKING
View file

@ -23,22 +23,31 @@ Here are some directions to get you started:
2.1 When using autotools 2.1 When using autotools
$ autoreconf -Wall -vis $ autoreconf -Wall -vis
2.2 When compiling 2.2 When compiling
$ export CFLAGS="-Wall -g -O2 -Wextra -pipe -funsigned-char -fstrict-aliasing \ 2.2.1 Using extra flags:
-Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wunused \ $ export CFLAGS="-Wall -g -O2 -Wextra -pipe -funsigned-char -fstrict-aliasing \
-Wuninitialized -Wpointer-arith -Wredundant-decls -Winline -Wformat \ -Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wunused \
-Wformat-security -Wswitch-enum -Winit-self -Wmissing-include-dirs \ -Wuninitialized -Wpointer-arith -Wredundant-decls -Winline -Wformat \
-Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition \ -Wformat-security -Wswitch-enum -Winit-self -Wmissing-include-dirs \
-Wbad-function-cast -Wnested-externs -Wmissing-declarations" -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition \
$ ./configure -Wbad-function-cast -Wnested-externs -Wmissing-declarations"
$ make clean $ ./configure
$ make $ make clean
You can chase even more issues by using clang: $ make
$ scan-build ./configure 2.2.2 Using clang:
$ make clean $ scan-build ./configure
$ scan-build make $ make clean
And by using cppcheck: $ scan-build make
$ cppcheck --quiet --enable=all --std=c99 --std=posix \ 2.2.3 Using cppcheck (v1.58 or higher):
-I include -I libnfc -I libnfc/buses . $ cppcheck --quiet \
-I include -I libnfc -I libnfc/buses -I libnfc/chips -I libnfc/drivers \
--check-config .
$ cppcheck --quiet --enable=all --std=posix --std=c99 \
-I include -I libnfc -I libnfc/buses -I libnfc/chips -I libnfc/drivers \
-DLOG -D__linux__ \
-DDRIVER_PN53X_USB_ENABLED -DDRIVER_ACR122_PCSC_ENABLED \
-DDRIVER_ACR122_USB_ENABLED -DDRIVER_ACR122S_ENABLED \
-DDRIVER_PN532_UART_ENABLED -DDRIVER_ARYGON_ENABLED \
--force .
2.3 When Debianizing 2.3 When Debianizing
$ lintian --info --display-info --display-experimental *deb $ lintian --info --display-info --display-experimental *deb
or (shorter version) or (shorter version)