Patch will follow ...
Created attachment 17296 [details] patch for 4.16
Created attachment 17298 [details] patch for 4.15
Comment on attachment 17296 [details] patch for 4.16 Shouldn't we fix the code?
The code is correct, it has if (count >= 1) { max_n[count] ... } Just gcc is not able to detect this. If you want to fix it you need to fully rewrite the code.
I've talked to gcc people, they suggested just this solution.
Moreover, this is the one in lib/util. source3/lib/util has its own flavor that does SMB_MALLOC....
The bug didn't go away when I talloc'ed max_n.
Don't we need check if the compiler supports the option? And we may want to split out a SAMBA_SUBSYSTEM for the affected file we don't want to allow new warnings in other files
At least v4-16-test + the patches from bug #15095 build fine on Fedora 36 with gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1) Can we drop this and revert 00e31d9d069db9fd36bf2e668047921a5645351d in master?
This bug was referenced in samba master: f340b8847242a7d6ae81e37118c6a6d352fb2d66
Created attachment 17429 [details] patch for 4.16 and 4.15