You upgrade an IPv4 address to an IPv6 address by appending it to 64:ff9b::/96, or whichever /96 prefix your ISP has chosen. For example, in an NAT64-enabled network, connecting to 64:ff9b::1.1.1.1 will get you to 1.1.1.1 as expected.
Fun with IP address parsing - https://news.ycombinator.com/item?id=25545967 - Dec 2020 (146 comments)
> This is the same IP address: 3232271615. You get that by interpreting the 4 bytes of the IP address as a big-endian unsigned 32-bit integer, and print that. This leads to a classic parlor trick: if you try to visit http://3232271615 , Chrome will load http://192.168.140.255.
murkans have been using ten digits as phone numbers for some decades now (no country code), I'm kinda bummed there isn't some saudi royalty paying four billion for a set of matching ip address and phone number.
All the other questions are much safer since they will at worst produce a failure, but it would probably be best to be extra-strict for them too.
In a sensible world inet_pton would be deprecated with a compiler warning and replaced with inet_pton2 that just accepted the sensible subset.
The HTTP RFCs actually do restrict the format within URIs, but modern browsers are still more liberal
https://www.rfc-editor.org/rfc/rfc3986#section-3.2.2
One thing I've previously lamented is how IPv6 requires parens for IP:port pair string - particularly problematic if you want to be able to have a default port when the suffix is missing.