3 ms·
warning: comparison is always true due to limited range of data type Surely this is a serious problem on 16 bit builds; the comparison implies that larger valu
by joosters 10y ago
warning: comparison is always true due to limited range of data type
Surely this is a serious problem on 16 bit builds; the comparison implies that larger values are expected to be stored in this variable, the warning is a strong hint that the (size of the) types are incorrect.
- simias 10y agoIn my experience it's generally not the case, you generally do these tests if you're about to truncate a value or do sanity checks. If the value is too big to fit the variable then it should've been caught earlier, when the value was loaded in the first place (i.e. strtol or whatever).