> On 4 Feb 2023, at 20:20, Paul Eggert wrote: > > On 2023-02-04 11:53, Sam James wrote: >> I'd consider using #pragma GCC ... to suppress -Wuse-after-free >> for the "problematic" lines instead. It'd avoid the risk of either optimisations or sanitisers >> respectively causing us pain in future. > > I don't see why that pragma would avoid those problems. All it would do is shut off the warnings; GCC's underlying analyses would be the same, and GCC would generate the same machine code. In that sense these warnings are useful - they're canaries in the coal mine. I guess it's hard for me to say given I don't know what options allowed it to be reproduced and I couldn't hit it. I assumed it must have been -Wstrict-aliasing=2 or lower which makes it more aggressive at the risk of false positives. But if you reproduced it, then it's useful, I suppose.