LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1023|回复: 3

HELP!!! "(void)整形变量;"奇怪的语句,这条语句是啥意思?

[复制链接]
发表于 2009-8-14 16:20:26 | 显示全部楼层 |阅读模式
handle_sigchld(int duff)
{
  unsigned int reap_one = 1;
  (void) duff;  //就是这条语句,奇怪
  while (reap_one)
  {
    reap_one = (unsigned int)vsf_sysutil_wait_reap_one();
    if (reap_one)
    {
      struct vsf_sysutil_ipaddr* p_ip;
      /* Account total number of instances */
      --s_children;
      /* Account per-IP limit */
      p_ip = (struct vsf_sysutil_ipaddr*)
        hash_lookup_entry(s_p_pid_ip_hash, (void*)&reap_one);
      drop_ip_count(p_ip);      
      hash_free_entry(s_p_pid_ip_hash, (void*)&reap_one);
    }
  }
}
发表于 2009-8-16 10:33:21 | 显示全部楼层
难道是传说中的去告警?
回复 支持 反对

使用道具 举报

发表于 2009-8-28 17:14:25 | 显示全部楼层
传入的参数duff实际在函数体里没用,而硬加了一个(void)操作,表示用到了,看来是为了欺骗下编译器。
回复 支持 反对

使用道具 举报

发表于 2009-9-4 12:49:56 | 显示全部楼层
无用的强制转换,楼上高见.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表