cyclonedds
cyclonedds copied to clipboard
Fix GCC 12 analyzer warnings
GCC 12 has a much improved static analyzer, and this PR takes care of most of the warnings it gives after enabling all of them.
There are still a few false positives in IDLC (generating idlc.c, generating type objects) that I have suppressed locally here, and there are some issues left in some test cases. So it is not quite ready for prime-time yet.
Another problem is that Azure only just added an Ubuntu 22.04 image, that Ubuntu 22.04 doesn't yet include gcc 12, and that the package repository of Ubuntu currently gives you gcc 12.0.1 instead of 12.1.0, and apparently a lot improved in the static analyzer between those two.
I think the changes are worth considering, even if perhaps it is still too early to actually switch platforms and enable all warnings from the static analyzer.