Nov. 24, 2023
10:14 p.m.
On 2023-11-24 08:22, Alois Treindl via tz wrote:
The use of union to save memory is dangerous, in my opinion. There is no need in today's machines to save a few kilobytes of RAM for a process. Not even in embedded software for watches.
When the memory is on the stack it still makes sense in some cases to save even a few kilobytes of RAM, as highly-threaded apps often have surprisingly small stacks. And anyway, the union has nothing to do with this particular bug. Thanks for reporting the problem. I installed the attached patches. The first patch fixes the bug; the second is a minor cleanup I noticed while in the neighborhood. The first patch clears just two slots rather than the entire struct, to avoid masking other errors.