Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Haster <geky@geky.net>2022-11-10 19:31:42 +0300
committerGitHub <noreply@github.com>2022-11-10 19:31:42 +0300
commitd8c96abf92945681e3737ee9cf23492d7794fce7 (patch)
tree964d50e6146fe2905a50d6344679c83f50b06a5b
parent007be6fd11b45a89fccd014e016ab784f1b943da (diff)
parent47914b925fd8dd558b68dffc826f9a4097519e0e (diff)
Merge pull request #724 from littlefs-project/clang-lint
Fix self-assign warnings discovered by clang, remove some warning flags
-rw-r--r--.github/workflows/test.yml21
-rw-r--r--Makefile3
-rw-r--r--lfs.c5
3 files changed, 22 insertions, 7 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index bc8bb0c..81f00c1 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -292,6 +292,27 @@ jobs:
- name: test-valgrind
run: make test TESTFLAGS+="-k --valgrind"
+ # test that compilation is warning free under clang
+ clang:
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: install
+ run: |
+ # need toml, also pip3 isn't installed by default?
+ sudo apt-get update -qq
+ sudo apt-get install -qq python3 python3-pip
+ sudo pip3 install toml
+ - name: install-clang
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -qq clang
+ echo "CC=clang" >> $GITHUB_ENV
+ clang --version
+ # no reason to not test again
+ - name: test-clang
+ run: make test TESTFLAGS+="-k"
+
# self-host with littlefs-fuse for a fuzz-like test
fuse:
runs-on: ubuntu-20.04
diff --git a/Makefile b/Makefile
index 7cc59f8..1387933 100644
--- a/Makefile
+++ b/Makefile
@@ -41,8 +41,7 @@ override CFLAGS += -DLFS_YES_TRACE
endif
override CFLAGS += -g3
override CFLAGS += -I.
-override CFLAGS += -std=c99 -Wall -pedantic
-override CFLAGS += -Wextra -Wshadow -Wjump-misses-init -Wundef
+override CFLAGS += -std=c99 -Wall -Wextra -pedantic
ifdef VERBOSE
override TESTFLAGS += -v
diff --git a/lfs.c b/lfs.c
index 6a56f94..530a48f 100644
--- a/lfs.c
+++ b/lfs.c
@@ -865,11 +865,6 @@ static int lfs_dir_traverse(lfs_t *lfs,
};
sp += 1;
- dir = dir;
- off = off;
- ptag = ptag;
- attrs = attrs;
- attrcount = attrcount;
tmask = 0;
ttag = 0;
begin = 0;