public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/107843] New: error: incompatible type for argument in ___bpf_ctx_cast2
@ 2022-11-23 17:37 james.hilliard1 at gmail dot com
  2022-12-06 18:27 ` [Bug target/107843] " david.faust at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: james.hilliard1 at gmail dot com @ 2022-11-23 17:37 UTC (permalink / raw)
  To: gcc-bugs

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)                          
    \
      |

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-10  9:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 17:37 [Bug target/107843] New: error: incompatible type for argument in ___bpf_ctx_cast2 james.hilliard1 at gmail dot com
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

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).