Created on 2026-06-10.00:00:00 last changed 2 weeks ago
The wording for `std::num_get::do_get` says that we determine a conversion specifier, but then that is never used. Stage 2 says it accumulates characters that are "allowed as the next character of an input field of the conversion specifier" but what says if they're allowed? We never say what the conversion specifier means. In C++03 Stage 3 of processing specified in terms of `scanf`, so the conversion specifier made sense (kind of ... but that wasn't explicit, it was still unspecified and do we mean conversion specification? I don't think `%p` is a conversion specifier, it's a conversion specification with the conversion specifier character `p`).
LWG 23 changed the spec to no longer refer to `scanf`, so now the meaning of the conversion specifier is even more unclear, and the manner in which `void*` is extracted is completely undefined. We use one of `strtol`, `strtoll`, `strtold` and (since LWG 1169) `strtof`, and `strtod`. But none of those can be used for `void*`.
Even if we say that `void*` still uses `scanf`, the representation of `void*` used for `scanf` in the C standard is also loosely specified. It says "Matches an implementation-defined set of sequences, which should be the same as the set of sequences that may be produced by the `%p` conversion of the `fprintf` function." And `fprintf` says "converted to a sequence of printing characters, in an implementation-defined manner."
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-06-10 00:00:00 | admin | create | |