Re:“People who implement new and improved interfaces always ...
by acveilleux on Friday September 11, 2015 @12:59PM
(#10204784)
Yeah, so it's a wrong thing in 2015 where the only significant use of octal is in unix permissions which themselves are only octal because of PDP-7/8.
The 9/18/36-bits architectures have lost but octal conventions of C was made on the PDP-7 (18 bits) and until the early 1980s, 36-bit machines were commercially available (PDP-10.)
Re:“People who implement new and improved interfaces always ...
by SixSigma on Friday September 11, 2015 @06:36PM
(#10206515)
I use octal with tr
Re:“People who implement new and improved interfaces always ...
by victorNicollet on Friday September 11, 2015 @12:20PM
(#10204561)
I agree. Still, that's the behaviour of parse_integer (specifically, base determination in _parse_integer_fixup_radix).
Re:“People who implement new and improved interfaces always ...
by detaro on Friday September 11, 2015 @12:27PM
(#10204596)
It is the specified behavior of the discussed code when not passing in a specified base to parse_integer. Now if that is a needed feature in the example context (or a fixed base of 10 would work as well) I don't know. It is an odd convention though, I agree. Hex I somewhat get, but octal?
At least with Hex you can't mistake the 0x prefix for anything else.
One of the best features of inet_pton over inet_addr is that the former doesn't do automatic conversions and instead assumes every field is a decimal number. The latter has a hidden trap where 192.168.0.11 is different than 192.168.000.011.