All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, "Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Martin KaFai Lau" <kafai@fb.com>,
	"Song Liu" <songliubraving@fb.com>, "Yonghong Song" <yhs@fb.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"KP Singh" <kpsingh@kernel.org>, "Björn Töpel" <bjorn@kernel.org>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
	"Jonathan Lemon" <jonathan.lemon@gmail.com>,
	"open list:BPF (Safe dynamic programs and tools)"
	<netdev@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] libbpf: replace typeof with __typeof__ for -std=c17 compatibility
Date: Thu, 9 Jun 2022 11:11:42 -0700	[thread overview]
Message-ID: <CAEf4BzaNBcW8ZDWcH5USd9jFshFF78psAjn2mqZp6uVGn0ZK+g@mail.gmail.com> (raw)
In-Reply-To: <20220609062829.293217-1-james.hilliard1@gmail.com>

On Wed, Jun 8, 2022 at 11:28 PM James Hilliard
<james.hilliard1@gmail.com> wrote:
>
> Fixes errors like:
> error: expected specifier-qualifier-list before 'typeof'
>    14 | #define __type(name, val) typeof(val) *name
>       |                           ^~~~~~
> ../src/core/bpf/socket_bind/socket-bind.bpf.c:25:9: note: in expansion of macro '__type'
>    25 |         __type(key, __u32);
>       |         ^~~~~~
>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---

If you follow DPDK link you gave me ([0]), you'll see that they ended up doing

#ifndef typeof
#define typeof __typeof__
#endif

It's way more localized. Let's do that.

But also I tried to build libbpf-bootstrap with -std=c17 and
immediately ran into issue with asm, so we need to do the same with
asm -> __asm__. Can you please update your patch and fix both issues?

  [0] https://patches.dpdk.org/project/dpdk/patch/2601191342CEEE43887BDE71AB977258213F3012@irsmsx105.ger.corp.intel.com/
  [1] https://github.com/libbpf/libbpf-bootstrap


>  tools/lib/bpf/bpf_core_read.h   | 16 ++++++++--------
>  tools/lib/bpf/bpf_helpers.h     |  4 ++--
>  tools/lib/bpf/bpf_tracing.h     | 24 ++++++++++++------------
>  tools/lib/bpf/btf.h             |  4 ++--
>  tools/lib/bpf/libbpf_internal.h |  6 +++---
>  tools/lib/bpf/usdt.bpf.h        |  6 +++---
>  tools/lib/bpf/xsk.h             | 12 ++++++------
>  7 files changed, 36 insertions(+), 36 deletions(-)
>

[...]

  reply	other threads:[~2022-06-09 18:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09  6:28 [PATCH 1/1] libbpf: replace typeof with __typeof__ for -std=c17 compatibility James Hilliard
2022-06-09 18:11 ` Andrii Nakryiko [this message]
2022-06-09 23:46   ` James Hilliard
2022-06-27 21:50     ` Andrii Nakryiko

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=CAEf4BzaNBcW8ZDWcH5USd9jFshFF78psAjn2mqZp6uVGn0ZK+g@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=james.hilliard1@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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.