【发布时间】:2013-05-28 13:25:45
【问题描述】:
Coverity 为什么会产生警告
> "cc" clobber ignored
对于下面提到的代码中的函数调用 htons() 和 ntohs()?
lSocketAddr.sin_port = htons(kUDPServerPort);
我用谷歌搜索发现这个警告也出现在英特尔编译器链中。 “cc”clobber被忽略是什么意思?这是否意味着不应将 htons() 和 ntohs() 用于安全编程?有什么办法可以解决这个警告吗?有没有替代的 apis htons() 和 ntohs()?
系统配置:
- 覆盖率 5.3
- 红帽 6
- GCC 版本 4.4.5
【问题讨论】: