Update code and StaticAnlysisTest so that missingInclude warnings do not have to be suppressed, and so that all code except for third party libraries can be checked.

Update SingleUSBModeTest makefile to separate out the messages from the test commands.
pull/1469/head
Dean Camera 13 years ago
parent e408f92b26
commit 9ffeac6992

@ -195,7 +195,9 @@ usb_dev_handle * open_usb_device(int vid, int pid)
struct usb_bus *bus; struct usb_bus *bus;
struct usb_device *dev; struct usb_device *dev;
usb_dev_handle *h; usb_dev_handle *h;
#ifdef LIBUSB_HAS_GET_DRIVER_NP
char buf[128]; char buf[128];
#endif
int r; int r;
usb_init(); usb_init();
@ -390,7 +392,6 @@ int write_usb_device(HANDLE h, void *buf, int len, int timeout)
if (r != WAIT_OBJECT_0) return 0; if (r != WAIT_OBJECT_0) return 0;
} }
if (!GetOverlappedResult(h, &ov, &n, FALSE)) return 0; if (!GetOverlappedResult(h, &ov, &n, FALSE)) return 0;
if (n <= 0) return 0;
return 1; return 1;
} }

@ -22,7 +22,7 @@ UC3_FAMILIES = uc3a0256 uc3a1256 uc3a3256 uc3a4256 uc3b0256 uc3b1256
DEVICE_FAMILIES = $(AVR8_FAMILIES:%=%.avr8) $(XMEGA_FAMILIES:%=%.xmega) $(UC3_FAMILIES:%=%.uc3) DEVICE_FAMILIES = $(AVR8_FAMILIES:%=%.avr8) $(XMEGA_FAMILIES:%=%.xmega) $(UC3_FAMILIES:%=%.uc3)
all: begin $(DEVICE_FAMILIES) end all: begin $(DEVICE_FAMILIES) clean end
begin: begin:
@echo Executing build test "ModuleTest". @echo Executing build test "ModuleTest".
@ -33,21 +33,21 @@ end:
@echo @echo
%.avr8: %.avr8:
$(MAKE) -f makefile.avr8 clean $(MAKE) -f makefile.avr8 clean -s
$(MAKE) -f makefile.avr8 all MCU=$(@:%.avr8=%) $(MAKE) -f makefile.avr8 all MCU=$(@:%.avr8=%) -s
%.xmega: %.xmega:
$(MAKE) -f makefile.xmega clean $(MAKE) -f makefile.xmega clean -s
$(MAKE) -f makefile.xmega all MCU=$(@:%.xmega=%) $(MAKE) -f makefile.xmega all MCU=$(@:%.xmega=%) -s
%.uc3: %.uc3:
$(MAKE) -f makefile.uc3 clean $(MAKE) -f makefile.uc3 clean -s
$(MAKE) -f makefile.uc3 all MCU=$(@:%.uc3=%) $(MAKE) -f makefile.uc3 all MCU=$(@:%.uc3=%) -s
clean: clean:
$(MAKE) -f makefile.avr8 clean $(MAKE) -f makefile.avr8 clean -s
$(MAKE) -f makefile.xmega clean $(MAKE) -f makefile.xmega clean -s
$(MAKE) -f makefile.uc3 clean $(MAKE) -f makefile.uc3 clean -s
%: %:

@ -12,30 +12,34 @@
# all module headers in a simple C and C++ # all module headers in a simple C and C++
# application. # application.
all: all: begin compile clean end
begin:
@echo Executing build test "SingleUSBModeTest". @echo Executing build test "SingleUSBModeTest".
@echo @echo
$(MAKE) -f makefile.avr8 clean end:
$(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_DEVICE_ONLY' @echo Build test "SingleUSBModeTest" complete.
$(MAKE) -f makefile.avr8 clean @echo
$(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_HOST_ONLY'
$(MAKE) -f makefile.xmega clean compile:
$(MAKE) -f makefile.xmega LUFA_OPTS='-D USB_DEVICE_ONLY' $(MAKE) -f makefile.avr8 clean -s
$(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_DEVICE_ONLY' -s
$(MAKE) -f makefile.avr8 clean -s
$(MAKE) -f makefile.avr8 LUFA_OPTS='-D USB_HOST_ONLY' -s
$(MAKE) -f makefile.uc3 clean $(MAKE) -f makefile.xmega clean -s
$(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_DEVICE_ONLY' $(MAKE) -f makefile.xmega LUFA_OPTS='-D USB_DEVICE_ONLY' -s
$(MAKE) -f makefile.uc3 clean
$(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_HOST_ONLY'
@echo Build test "SingleUSBModeTest" complete. $(MAKE) -f makefile.uc3 clean -s
@echo $(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_DEVICE_ONLY' -s
$(MAKE) -f makefile.uc3 clean -s
$(MAKE) -f makefile.uc3 LUFA_OPTS='-D USB_HOST_ONLY' -s
clean: clean:
$(MAKE) -f makefile.avr8 clean $(MAKE) -f makefile.avr8 clean -s
$(MAKE) -f makefile.xmega clean $(MAKE) -f makefile.xmega clean -s
$(MAKE) -f makefile.uc3 clean $(MAKE) -f makefile.uc3 clean -s
%: %:

@ -9,19 +9,36 @@
# Static anlysis of the entire LUFA source tree, using the free cross-platform "cppcheck" tool. # Static anlysis of the entire LUFA source tree, using the free cross-platform "cppcheck" tool.
# Path to the root of the LUFA tree to scan # Path to the root of the LUFA tree to scan
LUFA_ROOT_PATH = ../../ LUFA_ROOT_PATH = ../..
# Filenames or directories (including fragments) to exclude from the analysis # Filenames or directories (including fragments) to exclude from the analysis
EXCLUDE_LIST = HostLoaderApp/ FATFs/ PetiteFATFs/ uip/ EXCLUDE_LIST = FATFs/ \
PetiteFATFs/ \
uip/
# Output message template for found warnings and errors # Output message template for found warnings and errors
MESSAGE_TEMPLATE = "{file}({line}): {severity} ({id}): {message}" MESSAGE_TEMPLATE = "{file}:{line}: {severity} ({id}): {message}"
# Checks to suppress so that generated warnings are discarded # Checks to suppress so that generated warnings are discarded
SUPPRESS_WARNINGS = variableScope unusedFunction missingInclude SUPPRESS_WARNINGS = variableScope \
unusedFunction
all: # Extra paths to search for include files
cppcheck -q --std=c99 --check-config $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH) INCLUDE_PATHS = $(LUFA_ROOT_PATH)/LUFA/CodeTemplates/
cppcheck -q -f --std=c99 --error-exitcode=1 --inline-suppr --enable=all $(SUPPRESS_WARNINGS:%=--suppress=%) --template $(MESSAGE_TEMPLATE) $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)
all: begin staticcheck end
begin:
@echo Executing build test "StaticAnalysisTest".
@echo
end:
@echo Build test "StaticAnalysisTest" complete.
@echo
staticcheck:
cppcheck --quiet --inline-suppr --check-config $(SUPPRESS_WARNINGS:%=--suppress=%) --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)
cppcheck --quiet --inline-suppr --error-exitcode=1 --std=c99 --force --enable=all --inconclusive $(SUPPRESS_WARNINGS:%=--suppress=%) --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)
%: %:

@ -45,9 +45,10 @@
#include "AVRISPDescriptors.h" #include "AVRISPDescriptors.h"
#include "USARTDescriptors.h" #include "USARTDescriptors.h"
#include "Lib/SoftUART.h" // cppcheck-suppress missingInclude
#include "Lib/V2Protocol.h" #include "Lib/V2Protocol.h"
#include "Lib/SoftUART.h"
#include <LUFA/Version.h> #include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>

Loading…
Cancel
Save