You can do that if you have full control over the toolchain.
For example I ran into this issue with the AWS C++ SDK ( https://github.com/aws/aws-sdk-cpp/ ). And then I had to go into several CMake files and remove Werror. What do I as a user care about warnings? Can I only use that SDK once I have fixed (probably more like silenced) all the warnings?
At least they added a option now after a few years of this annoyance: https://github.com/aws/aws-sdk-cpp/issues/2555