Open jbeich opened 4 years ago
Reducing this to a lot fewer warnings:
$ scan-build15 --status-bugs make -s -j 5
scan-build: Using '/usr/local/llvm15/bin/clang-15' for static analysis
===> lib (all)
protocol.c:212:22: warning: Result of 'realloc' is converted to a pointer of type 'struct ref', which is incompatible with sizeof operand type 'struct smart_head' [unix.MallocSizeof]
smart_head->refs = realloc(smart_head->refs, sizeof(struct smart_head) * (count+1));
^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
protocol.c:212:22: warning: Result of 'realloc' is converted to a pointer of type 'struct ref', which is incompatible with sizeof operand type 'struct smart_head' [unix.MallocSizeof]
smart_head->refs = realloc(smart_head->refs, sizeof(struct smart_head) * (count+1));
^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
===> src (all)
===> src/tests (all)
index-pack.c:90:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores]
argc = argc - q;
^ ~~~~~~~~
1 warning generated.
update-index.c:110:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores]
argc = argc - q;
^ ~~~~~~~~
update-index.c:111:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores]
argv = argv + q;
^ ~~~~~~~~
2 warnings generated.
hash-object.c:205:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores]
argc = argc - q;
^ ~~~~~~~~
1 warning generated.
log.c:234:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores]
argc = argc - q;
^ ~~~~~~~~
log.c:235:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores]
argv = argv + q;
^ ~~~~~~~~
2 warnings generated.
clone.c:473:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores]
argc = argc - q;
^ ~~~~~~~~
1 warning generated.
scan-build: Analysis run complete.
scan-build: 8 bugs found.
scan-build: Run 'scan-view /tmp/scan-build-2023-12-28-155650-19121-1' to examine bug reports.