Should we enable warnings as errors?
These can be helpful to prevent unused variables and mismatched types.
It's a bit more of a burden on the user though.
One highly specific and unlikely example is here
for (int i = 0; dim - i >= 0; i++)
{
// Do stuff
}
Since dim is an unsigned int, i gets promoted to an unsigned by the compiler, leading to an infinite loop. In my experience compilers warn about the mismatched types and can help catch this.
It's kinda a minor edge case though.
No, I think it enough to just make sure the code that we provide is warning-free, then it falls on users to pay attention to their own warnings (as with any code). Also different compilers have different warning behavior, so this could cause working code to fail compile.
I would say definitely no on the app level, and also no on the library level.
This should be enabled in the CI