Re: [PATCH bpf-next] libbpf: fix non-C89 loop variable declaration in gen_loader.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 06, 2021 at 03:19:38AM IST, Andrii Nakryiko wrote:
> On Fri, Nov 5, 2021 at 1:40 PM Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> wrote:
> >
> > On Sat, Nov 06, 2021 at 12:40:55AM IST, Andrii Nakryiko wrote:
> > > Fix the `int i` declaration inside the for statement. This is non-C89
> > > compliant. See [0] for user report breaking BCC build.
> > >
> > >   [0] https://github.com/libbpf/libbpf/issues/403
> > >
> > > Fixes: 18f4fccbf314 ("libbpf: Update gen_loader to emit BTF_KIND_FUNC relocations")
> > > Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
> >
> > Thanks for the fix, and sorry about that.
> >
> > Acked-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>
> >
>
> No worries, we just need to figure out which compiler flags we need to
> catch this. I'm surprised BCC build caught this and neither libbpf's
> Makefile nor selftest did. Selftests are definitely too permissive
> w.r.t. stuff like this.
>
> If you could take a look and see what we'll need to lock it down a
> bit, that would be great. I've also requested help from the original
> reporter of this issue (see issue on Github).
>

I think you want -std=gnu89 (i.e. C89 with GNU extensions). I get the same error
as the reporter when building with that.

>
> > > [...]
> >
> > --
> > Kartikeya

--
Kartikeya



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux