On Fri, Jan 19, 2024 at 11:09:47PM +0000, Herbert, Marc wrote: > > > Anyway, with this it was very easy to reproduce and find the cause. > > Fixed and pushed, so mainline Sparse should be OK now. > > > Many thanks for the bug report, > > Fix confirmed, many thanks for the super quick fix! > > It's also great to see that you seem to have more time to spend on > sparse right now. If only ... > So trying to push my luck, here's the number 1 item on > my "Christmas Wish List": a combination of -Werror and -Wno-warn-about-X > options that would provides finer-grained and generally better control > on the exit status and output. After maintaining sparse automation for > many months, this is I think what would lower the CI adoption bar the > most. Yes, I can understand that. As far as I understand it, -Werror has been replaced by -Wsparse-error in 2014 because sparse was mainly used with exactly the same options as the ones used for the compiler (which is good), there was too much error messages and people didn't want to have their build to fail (see commits 4d8811879a1c & fe57afa0b44a). So, essentially the exact opposite of what you would like :( -Wsparse-error is really a pain because it also turn every warning into an error (and then exit on these errors). It should indeed be possible to have an exit(1) on errors but I'm very wary of changing the current behaviour. What about something like -ffail-on-error? > So far we've been using a brittle script that captures the incredibly > verbose and mostly unusable output (mostly due to some hard-to-fix > warnings located in common .h files) and "post-processes" it > with... "grep". > https://github.com/thesofproject/sof/commit/b7708182fbe5d > > I'm curious how people typically automate runnning sparse on the > Linux kernel. Does everyone "greps" logs too? Or is it more like > `$(wc -l) == 0`? I think so (but I could be very wrong). An exit on error is only useful if the output is clean and the errors not too frequent. I think it's often not the case. But, if your main problem is with error messages concerning address spaces, have you tried to simply use -Wno-address-space? Some other error messages issued by sparse can't be disabled but most of these are, I think, parsing or typing errors that are more or less unrecoverable. Purely for my own curiosity, could you send me one of your log of sparse errors? Best regards, -- Luc