conf: Use a temporary int variable to store GIC version
Since no value in the virGICVersion enumeration is negative, a clever enough compiler can report an error such as src/conf/domain_conf.c:15337:75: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare] if ((def->gic_version = virGICVersionTypeFromString(tmp)) < 0 || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ virGICVersionTypeFromString() can, however, return a negative value if the input string is not part of the enumeration, so we definitely need that check. Work around the problem by storing the return value in a temporary int variable.
Showing
想要评论请 注册 或 登录