且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有什么办法禁用所有警告用pragma在clang或gcc?

更新时间:2022-10-15 17:26:14

You can kind of do it with GCC, almost, using #pragma GCC diagnostic ignored, but unluckily not very well, see here.

The problem is that you cannot just "disable all", you have to disable each single one. Plus, for some warnings it doesn't work (and the docs don't tell you which ones...).

My guess is that this somewhat preliminary and will (hopefully) be improved in the next version.