On 2017-10-25 13:54:46 -0700, Phillip Remaker wrote:
Historically, C uses a 0 to precede an octal number, 0x to precede a decimal, and 0b for binary.
0b for binary is not C. It is used by some other languages, though (e.g. Perl).
Since 0x is not accepted,
That depends on the tool: % ping 0x8f.0x82.0x10.0x8 PING 0x8f.0x82.0x10.0x8 (143.130.16.8) 56(84) bytes of data. 64 bytes from 143.130.16.8: icmp_seq=1 ttl=55 time=8.37 ms 64 bytes from 143.130.16.8: icmp_seq=2 ttl=55 time=8.26 ms ... % ping -V ping utility, iputils-s20161105
There's probably some downstream library making the anachronistic assumption.
Possibly gethostbyname in the libc, but I haven't tested that. At least interpreting numbers with leading zeroes as octal is traditional on unix-like OSs (I probably first noticed that on Ultrix around 1990). I don't know why anyone thought this was a good idea. I wouldn't expect anyone to rely on it, but apparently nobody dares to get rid of that "feature". hp -- _ | Peter J. Holzer | we build much bigger, better disasters now |_|_) | | because we have much more sophisticated | | | hjp@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>