https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77760
Alexandre Oliva <aoliva at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aoliva at gcc dot gnu.org --- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> --- I'm looking at a case in which __clang__ is defined, despite compiling with GCC, and "%I...%p" parsing fails because the hack to pass state around doesn't work when __clang__ is defined. This got me thinking that there are more than enough bits in struct tm to encode all of __time_get_state in it, even with redundancy, so that overwritten fields could get recovered. I'm thinking that, before calling do_get, get would transfer its state onto struct tm in such a recoverable way, and, after calling it, it would restore state from struct tm and remove the extra out-of-range encodings. Our do_get, in turn, would extract state from struct tm, do its current job, and then pack the state back into struct tm. AFAICT this could be put in in an ABI-compatible way, dropping the hack and enabling libstdc++-specific do_get specializations to deal with such extended states, should we document them. Has anything along these lines already been considered and ruled out?