c++

屏蔽编译器警告

c++

Posted by YiMiTuMi on August 15, 2023

屏蔽编译器警告

屏蔽错误某段帶代碼警告:

#pragma warning(push)
#pragma warning(disable: 4996)   //错误编号

dnsInfo = gethostbyname(CT2A(inHost));  //bug 代码

#pragma warning(pop)

屏蔽整個庫或頭文件的警告:

#pragma  warning( push )
#pragma  warning( disable: 4458 4121 )  //錯誤代碼號

#include "GdiPlus.h"    
using namespace Gdiplus;

#pragma  warning(  pop  )