OSDN Git Service

tools/bpf: fix core_reloc.c compilation error
authorYonghong Song <yhs@fb.com>
Thu, 8 Aug 2019 00:38:56 +0000 (17:38 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 8 Aug 2019 01:24:03 +0000 (18:24 -0700)
commitb707659213d3c70f2c704ec950df6263b4bffe84
tree81b8a6622ccf7e0c99c19a7abe183cd918a3ac18
parent726e333fd2e95a14182fcfc1a4fe17725727a115
tools/bpf: fix core_reloc.c compilation error

On my local machine, I have the following compilation errors:
=====
  In file included from prog_tests/core_reloc.c:3:0:
  ./progs/core_reloc_types.h:517:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fancy_char_ptr_t’
 typedef const char * const volatile restrict fancy_char_ptr_t;
                                              ^
  ./progs/core_reloc_types.h:527:2: error: unknown type name ‘fancy_char_ptr_t’
    fancy_char_ptr_t d;
    ^
=====

I am using gcc 4.8.5. Later compilers may change their behavior not emitting the
error. Nevertheless, let us fix the issue. "restrict" can be tested
without typedef.

Fixes: 9654e2ae908e ("selftests/bpf: add CO-RE relocs modifiers/typedef tests")
Cc: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/core_reloc_types.h