On Sat, Dec 24, 2022 at 12:52:59PM +0100, Patrick Wildt wrote:
> On Thu, Dec 22, 2022 at 01:14:57AM +0100, Patrick Wildt wrote:
> > On Tue, Dec 20, 2022 at 05:48:41PM -0700, Todd C. Miller wrote:
> > > On Tue, 20 Dec 2022 23:44:08 +0100, Patrick Wildt wrote:
> > > 
> > > > clang complains when the function is declared with a fixed array size in
> > > > a parameter while the prototype is unbounded, like this:
> > > >
> > > > /usr/src/sys/net/pf.c:4353:54: error: argument 'sns' of type 'struct 
> > > > pf_src_n
> > > > ode *[4]' with mismatched bound [-Werror,-Warray-parameter]
> > > >     struct pf_rule_actions *act, struct pf_src_node *sns[PF_SN_MAX])
> > > >                                                      ^
> > > > /usr/src/sys/net/pf.c:203:28: note: previously declared as 'struct 
> > > > pf_src_nod
> > > > e *[]' here
> > > >                             struct pf_src_node *[]);
> > > >                                                 ^
> > > > 1 error generated.
> > > >
> > > > We have a few of that, and was wondering what the better solution is.
> > > > clang apparently accepts using * instead of [].  The alternative would
> > > > be to hardcode the size in the prototype as well.  Here's a diff for
> > > > a three files for the first version, as example.
> > > 
> > > Using * instead of [] is the saner approach.  Hard-coding the sizes
> > > into the prototype seems like a bad idea, even if clang is now smart
> > > enough to complain about a mismatch.
> > > 
> > >  - todd
> > 
> > So, here's the full diff that allows me to compile arm64 GENERIC.MP,
> > with radeondrm and amdgpu disabled.
> 
> Right, sorry for derailing the thread with a different discussion.
> Here's a diff only for the array/ptr changes.
> 
> ok?

ok tb

Reply via email to