当我启用Wsign-compare gcc警告标志以编译以下旧版代码时:
else if ((d_tag_utype) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
l_info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
+ DT_VERSIONTAGNUM] = dyn;
编译器在第一行给我警告:
../../dynamic_link.h:89:60: warning: comparison of promoted ~unsigned with constant [-Wsign-compare]
else if ((d_tag_utype) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
DT_EXTRANUM是定义为3的常量,并且是“ d_tag_utype => uint64_t”
我还尝试将“ DT_EXTRANUM”转换为(d_tag_utype)或(uint64_t),产生了同样的抱怨。
有什么主意是什么呢?