All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Networking <netdev@vger.kernel.org>,
	kernel-team@cloudflare.com
Subject: Re: [PATCH bpf-next] scripts/bpf: Emit an #error directive known types list needs updating
Date: Thu, 17 Oct 2019 11:50:30 +0200	[thread overview]
Message-ID: <875zknog49.fsf@cloudflare.com> (raw)
In-Reply-To: <CAEf4BzYUoGx9G6-8EYWReTamNGVmrOcWHEaqemRuv8+np1x17Q@mail.gmail.com>

On Wed, Oct 16, 2019 at 10:29 PM CEST, Andrii Nakryiko wrote:
> On Wed, Oct 16, 2019 at 6:21 AM Jakub Sitnicki <jakub@cloudflare.com> wrote:
>>
>> 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>
>> ---
>>  scripts/bpf_helpers_doc.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py
>> index 7df9ce598ff9..08300bc024da 100755
>> --- a/scripts/bpf_helpers_doc.py
>> +++ b/scripts/bpf_helpers_doc.py
>> @@ -489,7 +489,7 @@ class PrinterHelpers(Printer):
>>          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)
>
> My bad, this was intended to be printed to stderr, not to stdout
> output. Can you please do a follow up patch turning this into eprint
> instead?
>
> This shouldn't be reported by Clang, rather by tool. And we should
> ensure in libbpf's Makefile that bpf_helper_defs.h is deleted on
> error. I'll do it a bit later, unless you'll beat me to it.

This sounds sensible. I could have guessed it. Here's the fix:

https://lore.kernel.org/bpf/20191017094416.7688-1-jakub@cloudflare.com/T/#u

-Jakub

      reply	other threads:[~2019-10-17  9:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16  8:58 [PATCH bpf-next] scripts/bpf: Emit an #error directive known types list needs updating Jakub Sitnicki
2019-10-16 12:31 ` Daniel Borkmann
2019-10-16 20:29 ` Andrii Nakryiko
2019-10-17  9:50   ` Jakub Sitnicki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zknog49.fsf@cloudflare.com \
    --to=jakub@cloudflare.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=kernel-team@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.