Re: LLVM 15: mismatched bound errors

2022-12-26 Thread Todd C . Miller
On Tue, 27 Dec 2022 01:47:25 +0100, Jeremie Courreges-Anglas wrote: > That's for the kernel part. libsa diff below, ok? Of course. OK millert@ - todd

Re: LLVM 15: mismatched bound errors

2022-12-26 Thread Jeremie Courreges-Anglas
On Sat, Dec 24 2022, 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

Re: LLVM 15: mismatched bound errors

2022-12-26 Thread Jeremie Courreges-Anglas
On Thu, Dec 22 2022, Todd C. Miller wrote: > On Thu, 22 Dec 2022 02:08:42 +0100, Jeremie Courreges-Anglas wrote: > >> https://github.com/jcourreges/openbsd-src/commit/4862df383ccb8a8e03d5c11b4f >> b739b6a3a5a7c7 >> >> Sadly making the size available in the declaration doesn't seem to be >>

Re: LLVM 15: mismatched bound errors

2022-12-26 Thread Jeremie Courreges-Anglas
On Sat, Dec 24 2022, 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

Re: LLVM 15: mismatched bound errors

2022-12-24 Thread Todd C . Miller
On Sat, 24 Dec 2022 12:52:59 +0100, Patrick Wildt wrote: > Right, sorry for derailing the thread with a different discussion. > Here's a diff only for the array/ptr changes. OK millert@ After some testing this seems to only affect code where the prototype and the function declaration use a mix

Re: LLVM 15: mismatched bound errors

2022-12-24 Thread Theo Buehler
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

Re: LLVM 15: mismatched bound errors

2022-12-24 Thread Patrick Wildt
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

Re: LLVM 15: mismatched bound errors

2022-12-22 Thread Todd C . Miller
On Thu, 22 Dec 2022 02:08:42 +0100, Jeremie Courreges-Anglas wrote: > https://github.com/jcourreges/openbsd-src/commit/4862df383ccb8a8e03d5c11b4f > b739b6a3a5a7c7 > > Sadly making the size available in the declaration doesn't seem to be > clang any smarter (yet?). clang won't warn about

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Theo de Raadt
Jeremie Courreges-Anglas wrote: > On Wed, Dec 21 2022, "Theo de Raadt" wrote: > >> But yeah, maybe we'll just flip the default option in LLVM and then > >> we'll just not use that warning... at all? > > > > is this specific warning finding dangerous bugs? is it finding a > > substantial > >

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Jeremie Courreges-Anglas
On Wed, Dec 21 2022, "Theo de Raadt" wrote: >> But yeah, maybe we'll just flip the default option in LLVM and then >> we'll just not use that warning... at all? > > is this specific warning finding dangerous bugs? is it finding a substantial > number of dangerous bugs? No, but if we remove

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Theo de Raadt
> So for base we don't really need to tweak the defaults, I'd > rather see what happens in ports wrt -Wdeprecated-non-prototype, and > I don't think it's the biggest offender. If libz is hitting this, then I think the situation will be dire in ports. I think the clang developers are so busy

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Jeremie Courreges-Anglas
On Thu, Dec 22 2022, Patrick Wildt wrote: > Am Thu, Dec 22, 2022 at 01:57:37AM +0100 schrieb Jeremie Courreges-Anglas: >> On Thu, Dec 22 2022, Theo Buehler wrote: >> > On Thu, Dec 22, 2022 at 11:39:41AM +1100, Jonathan Gray wrote: >> >> On Thu, Dec 22, 2022 at 01:20:32AM +0100, Theo Buehler

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Theo de Raadt
> But yeah, maybe we'll just flip the default option in LLVM and then > we'll just not use that warning... at all? is this specific warning finding dangerous bugs? is it finding a substantial number of dangerous bugs?

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Jeremie Courreges-Anglas
On Tue, Dec 20 2022, 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

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Patrick Wildt
Am Thu, Dec 22, 2022 at 01:57:37AM +0100 schrieb Jeremie Courreges-Anglas: > On Thu, Dec 22 2022, Theo Buehler wrote: > > On Thu, Dec 22, 2022 at 11:39:41AM +1100, Jonathan Gray wrote: > >> On Thu, Dec 22, 2022 at 01:20:32AM +0100, Theo Buehler wrote: > >> > > Any concerns regarding the changes

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Jeremie Courreges-Anglas
On Thu, Dec 22 2022, Theo Buehler wrote: > On Thu, Dec 22, 2022 at 11:39:41AM +1100, Jonathan Gray wrote: >> On Thu, Dec 22, 2022 at 01:20:32AM +0100, Theo Buehler wrote: >> > > Any concerns regarding the changes in libz? It introduces diff to >> > > upstream, but the recent commits seemed to

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Theo de Raadt
Theo Buehler wrote: > On Thu, Dec 22, 2022 at 11:39:41AM +1100, Jonathan Gray wrote: > > On Thu, Dec 22, 2022 at 01:20:32AM +0100, Theo Buehler wrote: > > > > Any concerns regarding the changes in libz? It introduces diff to > > > > upstream, but the recent commits seemed to indicate we have

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Theo Buehler
On Thu, Dec 22, 2022 at 11:39:41AM +1100, Jonathan Gray wrote: > On Thu, Dec 22, 2022 at 01:20:32AM +0100, Theo Buehler wrote: > > > Any concerns regarding the changes in libz? It introduces diff to > > > upstream, but the recent commits seemed to indicate we have forked > > > anyway? > > > >

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Jonathan Gray
On Thu, Dec 22, 2022 at 01:20:32AM +0100, Theo Buehler wrote: > > Any concerns regarding the changes in libz? It introduces diff to > > upstream, but the recent commits seemed to indicate we have forked > > anyway? > > I've worked hard to keep the diff to upstream minimal. Why are these >

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Theo de Raadt
Theo Buehler wrote: > > Any concerns regarding the changes in libz? It introduces diff to > > upstream, but the recent commits seemed to indicate we have forked > > anyway? > > I've worked hard to keep the diff to upstream minimal. Why are these > changes needed? becauase clang believes they

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Theo Buehler
> Any concerns regarding the changes in libz? It introduces diff to > upstream, but the recent commits seemed to indicate we have forked > anyway? I've worked hard to keep the diff to upstream minimal. Why are these changes needed?

Re: LLVM 15: mismatched bound errors

2022-12-21 Thread Patrick Wildt
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: > > > >

Re: LLVM 15: mismatched bound errors

2022-12-20 Thread Todd C . Miller
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

LLVM 15: mismatched bound errors

2022-12-20 Thread Patrick Wildt
Hi, 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_node *[4]' with mismatched bound [-Werror,-Warray-parameter] struct