__owur 的作用是什么

根据介绍“New macro __owur for "OpenSSL Warn Unused Result". This makes use ofa gcc attribute to warn if the result of a function is ignored. This is enable if DEBUG_UNUSED is set. Add to several functions in evp.hwhose return value is often ignored. ”, __owur是一个宏,主要是为了在编译的时候发出警告,函数的返回值被忽略了,使用了此 宏修饰函数之后,在编译时设置了DEBUG_UNUSED,就会在编译的时候发出告警。openssl的evp.h的EVP_EncryptInit 、EVP_CipherUpdate、EVP_CipherFinal、EVP_CipherFinal_ex、EVP_SignFinal、EVP_DigestSign、EVP_VerifyFinal、EVP_DigestVerify、EVP_DigestSignFinal、EVP_DigestVerifyInit、EVP_DigestVerifyFinal、EVP_OpenInit、EVP_OpenFinal、EVP_SealInit、EVP_SealFinal等函数都加了此宏。建议通过编译器来提示错误还是不能彻底解决问题,还是形成良好的编程习惯比较好。


参考:https://www.openssl.org/news/cl110.txt

发布了85 篇原创文章 · 获赞 9 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/jimmyleeee/article/details/98938805