find code causing warning 4503 in VC++

偶尔善良 提交于 2019-12-08 13:17:26

My question was how to find which line of code is causing the problem, but that wouldn't actually solve my problem. Since the offending code involves templating, the decorated name which cl warns about is generated after the rest of the code in the translation unit is processed, and so I would not be able to surround any given piece of code with a warnings(push)/warning(pop) pair.

The solution for me was to put #pragma warning(disable:4503) at the end of the file (I put it just before the #endif of the include guard). This silences the warning for all decorated names generated from structures in the file which use tempaltes. The scope of a warning(...) pragma is just to the current translation unit, so this doesn't affect any other files.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!