public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "james.hilliard1 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/107843] New: error: incompatible type for argument in ___bpf_ctx_cast2
Date: Wed, 23 Nov 2022 17:37:33 +0000	[thread overview]
Message-ID: <bug-107843-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107843

            Bug ID: 107843
           Summary: error: incompatible type for argument in
                    ___bpf_ctx_cast2
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: james.hilliard1 at gmail dot com
  Target Milestone: ---

I'm seeing this error which does not occur in llvm for a bpf test(bpf_cubic.c)
in bpf-next:

In file included from
/home/buildroot/bpf-next/tools/testing/selftests/bpf/bpf_tcp_helpers.h:9,
                 from progs/bpf_cubic.c:20:
progs/bpf_cubic.c: In function 'bpf_cubic_cwnd_event':
/home/buildroot/bpf-next/tools/bpf/resolve_btfids/libbpf/include/bpf/bpf_tracing.h:399:63:
error: incompatible type for argument 3 of '____bpf_cubic_cwnd_event'
  399 | #define ___bpf_ctx_cast2(x, args...)  ___bpf_ctx_cast1(args), (void
*)ctx[1]
      |                                                              
^~~~~~~~~~~~~~
      |                                                               |
      |                                                               void *
/home/buildroot/bpf-next/tools/bpf/resolve_btfids/libbpf/include/bpf/bpf_helpers.h:187:29:
note: in expansion of macro '___bpf_ctx_cast2'
  187 | #define ___bpf_concat(a, b) a ## b
      |                             ^
/home/buildroot/bpf-next/tools/bpf/resolve_btfids/libbpf/include/bpf/bpf_helpers.h:190:29:
note: in expansion of macro '___bpf_concat'
  190 | #define ___bpf_apply(fn, n) ___bpf_concat(fn, n)
      |                             ^~~~~~~~~~~~~
/home/buildroot/bpf-next/tools/bpf/resolve_btfids/libbpf/include/bpf/bpf_tracing.h:410:39:
note: in expansion of macro '___bpf_apply'
  410 | #define ___bpf_ctx_cast(args...)      ___bpf_apply(___bpf_ctx_cast,
___bpf_narg(args))(args)
      |                                       ^~~~~~~~~~~~
/home/buildroot/bpf-next/tools/bpf/resolve_btfids/libbpf/include/bpf/bpf_tracing.h:435:27:
note: in expansion of macro '___bpf_ctx_cast'
  435 |         return ____##name(___bpf_ctx_cast(args));                      
    \
      |                           ^~~~~~~~~~~~~~~
progs/bpf_cubic.c:189:6: note: in expansion of macro 'BPF_PROG'
  189 | void BPF_PROG(bpf_cubic_cwnd_event, struct sock *sk, enum tcp_ca_event
event)
      |      ^~~~~~~~
progs/bpf_cubic.c:189:72: note: expected 'enum tcp_ca_event' but argument is of
type 'void *'
  189 | void BPF_PROG(bpf_cubic_cwnd_event, struct sock *sk, enum tcp_ca_event
event)
      |                                                     
~~~~~~~~~~~~~~~~~~^~~~~
/home/buildroot/bpf-next/tools/bpf/resolve_btfids/libbpf/include/bpf/bpf_tracing.h:430:39:
note: in definition of macro 'BPF_PROG'
  430 | ____##name(unsigned long long *ctx, ##args);                           
    \
      |                                       ^~~~
/home/buildroot/bpf-next/tools/bpf/resolve_btfids/libbpf/include/bpf/bpf_tracing.h:435:16:
error: 'return' with a value, in function returning void [-Werror]
  435 |         return ____##name(___bpf_ctx_cast(args));                      
    \
      |                ^~~~
progs/bpf_cubic.c:189:6: note: in expansion of macro 'BPF_PROG'
  189 | void BPF_PROG(bpf_cubic_cwnd_event, struct sock *sk, enum tcp_ca_event
event)
      |      ^~~~~~~~
progs/bpf_cubic.c:189:15: note: declared here
  189 | void BPF_PROG(bpf_cubic_cwnd_event, struct sock *sk, enum tcp_ca_event
event)
      |               ^~~~~~~~~~~~~~~~~~~~
/home/buildroot/bpf-next/tools/bpf/resolve_btfids/libbpf/include/bpf/bpf_tracing.h:431:17:
note: in definition of macro 'BPF_PROG'
  431 | typeof(name(0)) name(unsigned long long *ctx)                          
    \
      |

             reply	other threads:[~2022-11-23 17:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 17:37 james.hilliard1 at gmail dot com [this message]
2022-12-06 18:27 ` [Bug target/107843] " david.faust at oracle dot com
2023-01-06 14:28 ` jemarch at gcc dot gnu.org
2023-01-10  9:15 ` jemarch at gcc dot gnu.org

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=bug-107843-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).