Bugzilla – Bug 994
PointToPointGridHelper useless if clauses
Last modified: 2010-09-16 15:52:25 UTC
Created attachment 976 [details] Proposed patch ../src/helper/point-to-point-grid-helper.cc:181:11: error: ] comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (row < 0 || col < 0 || ~~~ ^ ~ row and col in GetNode and GetIpv4Address are both uint32_t, thus can never be below 0 - if clause always false.
The proposed patch is for a different bug, but I went ahead and just fixed by removing those cases out of those two if statements (line 181 and 193). BTW, the if clause is not *always* false, as these are logical ORs and there are other cases within that conditional that could evaluate to true. I went ahead and removed them anyway, since they are simply unnecessary.