當在VS 2010中使用Boost 1.4編譯以下C++代碼時,我收到C4503警告消息(「裝飾名稱長度超出,名稱被截斷」,3次)。 9:當在Boost周圍使用「#pragma警告」時,警告C4503包括
#include <vector>
#include <map>
#pragma warning (push, 1)
#include <boost/units/quantity.hpp>
#include <boost/units/si/plane_angle.hpp>
#pragma warning (pop)
using namespace boost::units;
typedef std::pair<quantity<si::plane_angle>, quantity<si::plane_angle> > Section;
std::vector<Section> getEmptyVector()
{
std::vector<Section> sections;
return sections;
}
這讓我爲難的是,報警消失,只有當我刪除的#pragma
指令的事情。有沒有解釋,或編譯器有錯誤?
Boost試圖爲不同編譯器壓制不必要的警告。如果您看到很多這些信息,請使用特定的編譯器,警告級別和標題來觸發警告,並提交錯誤報告。 – pmr 2012-03-12 15:45:28
在我意識到它與全球變暖無關之前,我必須三次閱讀這個問題。 – Ferruccio 2012-03-12 19:25:17
謝謝,我改變了標題。 – 2012-03-12 19:35:38