Re: Static array indices in function parameter declarations

Brandon Cheo Fusi <[email protected]> Wed, 26 Apr 2023 09:44:22 +0100
Newsgroups dev.linux.lists.ell
Message-ID <CAEVJM+p_sc865hJEvxWv648EBk978DpF+ChdafCECbi66GHpPQ@mail.gmail.com>
Hi Marcel,

Thanks for clearing that up. My goal was to link against -lell from
C++. And the only errors that turned up were the implicit void* casts
(silenced with -fpermissive) and the static array indices thing.

I'll submit a patch before the weekend.

Regards,
Brandon.

On Tue, Apr 25, 2023 at 5:24 PM Marcel Holtmann <[email protected]> wrote:
>
> Hi James,
>
> >> I'm currently using ell for talking to dbus, and have found it way
> >> more convenient and easier to use as compared to gdbus, or any of the
> >> other bindings I've looked at. So many thanks.
> >> The extern "C"  usage in the header files show the library is allowed
> >> to be compiled with C++ code. However the usage of the C99 feature
> >> that allows one to declare the index of the argument array using the
> >> 'static' keyword in some header files (like rtnl.h:110) seems to
> >> prevent this.
> >> Is there a workaround for this issue?  Or should I submit a patch that
> >> removes all usage of this feature.
> >
> > Is this you're only issue compiling ELL with C++ code? I ask because I quickly tried:
> >
> > ~/ell$ g++ -o ell/rtnl.o ell/rtnl.c -I.
> >
> > And I got a TON of errors. Mostly void* pointer arithmetic and missing casts from void* to other types.
>
> and that was never the goal. You always have to build ELL with a C compiler.
>
> That you might be able to link against -lell from a C++ is an option, but
> our work just including the C++ boilerplate in the headers. And then it
> stopped exactly there. So we need external contributions if things do not
> work.
>
> Regards
>
> Marcel
>