This is thought. I'm pretty sure +90% of those warning can be ignored.
I had similar problem and lots of warning on something like this:
sumeType tab[10];
int items = std::size(tab);
// or
functionWhichExeptsInt(std::size(tab))
In above example since std::size
is a constexpr
compiler could just detect that size value is small enough to fit into int
so it should not report an warring but it does.
Problem is that there might be a cases where this warning can detect a real issue.
So disabling this warning is not a good approach.
In my project we have decided to keep warring, but do not threat it as an error:
- we reviewed them quickly, if something could be fixed by minimum change we did that
- when required change was more complex, we just estimated potential danger of having a bug (after all we changed app from 32 to 64 bits to gain access to more memory). If didn't see a risk, we just ignore it for now
- we fix remaining warnings as code changes and we do not rash to fix them all now.
This is more like mental problem: "Can I ignore those +100 warning for now?". I also love code without warnings reported, but some times it is better to live with them.
IMO this is more safe approach.