It actually works fine under certain conditions, but there are caveats.
First, it works with C++ files, but not with C files. This is an issue when setting it for the Code::Blocks project, but you would not want to do that anyway.
You will want to set it for the smallest possible subset, which is the SDK target in this case.
This, however, means that the major part of Code::Blocks (over 400 files) is compiled without this warning, which is bad. If the build system allowed us to pass custom compiler flags to individual files, that might be acceptable, but compiling the whole SDK this way is dangerous - it may hide actual errors in other places.
Lastly and most importantly, when using older compiler versions, you would expect it to produce additional warnings about unknown command line options in addition to the existing ones.
However, reality is still worse. gcc will actually bail out with an error, so the build is broken.