Skip to content

Commit

Permalink
scripts/bpf: Emit an #error directive known types list needs updating
Browse files Browse the repository at this point in the history
Make the compiler report a clear error when bpf_helpers_doc.py needs
updating rather than rely on the fact that Clang fails to compile
English:

../../../lib/bpf/bpf_helper_defs.h:2707:1: error: unknown type name 'Unrecognized'
Unrecognized type 'struct bpf_inet_lookup', please add it to known types!

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191016085811.11700-1-jakub@cloudflare.com
  • Loading branch information
jsitnicki authored and borkmann committed Oct 16, 2019
1 parent 5bc60de commit 456a513
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/bpf_helpers_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def map_type(self, t):
if t in self.mapped_types:
return self.mapped_types[t]
print("")
print("Unrecognized type '%s', please add it to known types!" % t)
print("#error \"Unrecognized type '%s', please add it to known types!\"" % t)
sys.exit(1)

seen_helpers = set()
Expand Down

0 comments on commit 456a513

Please sign in to comment.