On Sat, Dec 24 2022, Patrick Wildt <patr...@blueri.se> 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?

A bit late to this party but ok jca@, thanks.

Why do you mention building arm64 GENERIC.MP "with radeondrm and amdgpu
disabled"?  Don't those drivers build with llvm15?

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to