krestenkrab / hanoidb

Erlang LSM BTree Storage
Apache License 2.0
307 stars 58 forks source link

compiler and dialyzer warnings #15

Open norton opened 12 years ago

norton commented 12 years ago

There are some compiler and dialyzer warnings that would be nice to fix. As time permits, I may also try to fix some of these.

compiler warnings:

src/hanoidb_fold_worker.erl:71: Warning: record state has field(s) without type     
src/hanoidb_level.erl:53: Warning: record state has field(s) without type information
src/basho_bench_driver_hanoidb.erl:27: Warning: record state has field(s) without type information
src/basho_bench_driver_hanoidb.erl:79: Warning: variable 'SyncInterval' exported from 'case' (

dialyzer Unknown functions: hanoidb_utils:has_expired/1

dialyzer "nospec" warnings: .... too many to list ....

I often find the following 2 passes of dialyzer to be quite helpful: first with no_spec and next with unmatched_returns.

diff --git a/Makefile b/Makefile
index 5071ea4..09ced93 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,13 @@ plt: compile
 analyze: compile
        $(DIALYZER) --plt .hanoi.plt \
        -pa deps/plain_fsm/ebin \
+       -Wunmatched_returns \
+       ebin
+
+analyze-nospec: compile
+       $(DIALYZER) --plt .hanoi.plt \
+       -pa deps/plain_fsm/ebin \
+       --no_spec \
        ebin