syzkaller/executor
Dmitry Vyukov 424dd8e7b5 executor: warn about C89-style var declarations
We generally use the newer C99 var declarations combined with initialization because:
 - declarations are more local, reduced scope
 - fewer lines of code
 - less potential for using uninit vars and other bugs
However, we have some relic code from times when we did not understand
if we need to stick with C89 or not. Also some external contributions
that don't follow style around.

Add a static check for C89-style declarations and fix existing precedents.

Akaros toolchain uses -std=gnu89 (or something) and does not allow
variable declarations inside of for init statement. And we can't switch
it to -std=c99 because Akaros headers are C89 themselves.
So in common.h we need to declare loop counters outside of for.
2020-08-14 09:40:08 +02:00
..
android executor: minor cleanup of android sandbox 2020-03-11 12:09:17 +01:00
common_akaros.h executor: fix do_sandbox_none on akaros and test 2019-01-31 11:35:53 +01:00
common_bsd.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
common_fuchsia.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
common_kvm_amd64.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
common_kvm_arm64.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
common_linux.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
common_test.h executor: make syz_compare output more handy to use 2019-12-20 16:45:33 +01:00
common_usb_linux.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
common_usb_netbsd.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
common_usb.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
common_windows.h executor: fix do_sandbox_none on akaros and test 2019-01-31 11:35:53 +01:00
common.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
executor_akaros.h executor: change syscall argument type to intptr_t 2019-05-07 08:48:35 +02:00
executor_bsd.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
executor_fuchsia.h executor/fuchsia: Don't map memory as executable. 2020-06-05 16:46:48 -03:00
executor_linux.h executor/linux: dump more information when failed to open kcov file 2020-08-13 15:56:42 +02:00
executor_test.h executor: change syscall argument type to intptr_t 2019-05-07 08:48:35 +02:00
executor_windows.h executor: change syscall argument type to intptr_t 2019-05-07 08:48:35 +02:00
executor.cc executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
gen.go executor: enable KVM generator only on AMD64 arch 2020-06-17 17:43:56 +02:00
kvm_gen.cc Makefile: enable clang-tidy in presubmit tests 2020-08-04 16:54:02 +02:00
kvm.h sys: improve kvm description 2017-01-28 19:58:31 +01:00
kvm.S executor: remove unused kvm_asm64_vm86 2019-01-17 10:52:20 +01:00
kvm.S.h all: fix marking of auto-generated files 2020-07-29 13:36:11 +02:00
nocover.h executor: Protect the coverage buffer 2019-06-04 16:24:36 +02:00
stub.go .golangci.yml: enable godot checker 2020-06-05 12:23:19 +02:00
style_test.go executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00
test_linux.h executor: add some code style checks 2020-08-06 15:27:41 +02:00
test.h executor: warn about C89-style var declarations 2020-08-14 09:40:08 +02:00