Overflow
Overflow
Using int
can have trouble with integers as small as 64k32K. Consider a version using a time stamp of 14 digits as one of the fields 20220302101901
. Use some unsigned type, perhaps uintmax_t
. Even then I would consider detecting overflow - or see below.
What if non-digit or non-dot?
What if non-digit or non-dot?
Since separators like ,
, and letters are treated pathologically like digits, how about giving those meaning as separators and not useusing them to computercompute the version value?
NULL?
NULL?
Since version compare is often done near the beginning of code and the result is very important, I'd like the comparecomparison to tolerate more of the usual mistakes like NULL
or effect some error message.
Unlimited integer precession