Skip to content

Commit b707659

Browse files
yonghong-songAlexei Starovoitov
authored andcommitted
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: 9654e2a ("selftests/bpf: add CO-RE relocs modifiers/typedef tests") Cc: Andrii Nakryiko <[email protected]> Signed-off-by: Yonghong Song <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 726e333 commit b707659

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/progs/core_reloc_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ typedef arr1_t arr2_t;
514514
typedef arr2_t arr3_t;
515515
typedef arr3_t arr4_t;
516516

517-
typedef const char * const volatile restrict fancy_char_ptr_t;
517+
typedef const char * const volatile fancy_char_ptr_t;
518518

519519
typedef core_reloc_mods_substruct_t core_reloc_mods_substruct_tt;
520520

0 commit comments

Comments
 (0)