On Fri, 19 Apr 2024 at 10:08, Jonathan Wakely wrote: > > On Fri, 19 Apr 2024 at 07:14, Richard Biener wrote: > > > > On Thu, Apr 18, 2024 at 6:34 PM Jonathan Wakely wrote: > > > > > > This would fix the but, how do people feel about it this close to the > > > gcc-14 release? > > > > Guess we'll have to fix it anyway, so why not now ... > > Yeah, I don't think Debian is going to stop using this feature, and it > might get used more widely in future (it's currently part of the > "vanguard" format for tzdata, but might move to "main" one day and > then all distros would have chained links). So it needs to be > backported to gcc-13 too. > > > (what could go wrong..) > > Well the risk is that my new code doesn't correctly detect cycles, and > so could go into an infinite loop when trying to follow chained links. > The current code on trunk will just fail to find a time_zone and throw > an exception, which is not ideal, but predictable and easily > understood. Attempting to handle chained links adds complexity. > > I think my new code is correct so that it won't get stuck in a loop, > and there are tests which should cover it sufficiently. And for > correctly tzdata.zi there will never be cycles anyway, so even if I > messed the code up, it shouldn't matter unless the application > provides a custom tzdata.zi with invalid links. > > So I guess I'll push it, and backport to gcc-13 soon. I've pushed the attached, which is the same as the earlier patch except for adding a new function to the testsuite/std/time/tzdb/1.cc test.