]> asedeno.scripts.mit.edu Git - linux.git/commit
selftests/bpf: fix a compilation error
authorYonghong Song <yhs@fb.com>
Thu, 18 Apr 2019 05:23:30 +0000 (22:23 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 18 Apr 2019 05:29:51 +0000 (22:29 -0700)
commitba02de1aa04e392e15ef503c6dd5166915d9d4de
treee58761f45f3ac89a6604ef325243f78b91066e75
parent193d0002ef04d331466f4d211d008ff8257bfa6a
selftests/bpf: fix a compilation error

I hit the following compilation error with gcc 4.8.5.

  prog_tests/flow_dissector.c: In function ‘test_flow_dissector’:
  prog_tests/flow_dissector.c:155:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
    for (int i = 0; i < ARRAY_SIZE(tests); i++) {
    ^
  prog_tests/flow_dissector.c:155:2: note: use option -std=c99 or -std=gnu99 to compile your code

Let us fix the issue by avoiding this particular c99 feature.

Fixes: a5cb33464e53 ("selftests/bpf: make flow dissector tests more extensible")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/flow_dissector.c