Expand compiler flags for static code analysis

This commit is contained in:
Thomas Klaehn 2019-07-15 13:27:17 +02:00
parent a6c2d808eb
commit 707c75131c
4 changed files with 13 additions and 7 deletions

14
.vscode/tasks.json vendored
View File

@ -8,9 +8,12 @@
"type":"shell",
"command": "make all -j4",
"problemMatcher": {
"base": "gcc",
"base": "$gcc",
"owner": "gcc",
"fileLocation":"absolute"
"fileLocation": [
"relative",
"${workspaceFolder}"
]
},
"group": {
"kind": "build",
@ -22,9 +25,12 @@
"type":"shell",
"command": "make clean -j4",
"problemMatcher": {
"base": "gcc",
"base": "$gcc",
"owner": "gcc",
"fileLocation":"absolute"
"fileLocation": [
"relative",
"${workspaceFolder}"
]
},
"group": {
"kind": "build",

View File

@ -20,7 +20,7 @@ LIBS := ftdi
endif
LD_FLAGS :=
C_FLAGS := -O0 -g
C_FLAGS := -O0 -g -Wall -Wextra -Werror
CPP_FLAGS := $(addprefix -I, $(INCLUDES))
C_SRCS = $(wildcard $(SRC_DIR)/*.c)

View File

@ -108,7 +108,7 @@ int gpio_read(const struct gpio *gpio, unsigned int *value)
int gpio_write(const struct gpio *gpio, unsigned int value)
{
int res;
unsigned char mask;
unsigned char mask = gpio->ftdi_dev->status_mask;
if(NULL == gpio) {
return EXIT_FAILURE;

View File

@ -31,7 +31,7 @@ static const struct gpio gpio_2 = {
.ftdi_dev = &ftdi_obj,
};
int main(int argc, char *argv[])
int main(void)
{
int res, cnt;
unsigned int value;