Closed bgottula closed 1 year ago
Having a look.
The obvious real problem here is that the SER format was designed by an idiot
One possible workaround that might work, maybe: using #pragma pack
instead of packed
attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36566#c11
Another workaround would be to just declare an int32_t
in that block scope, assign it the value of header_->FrameCount
and then pass that in to the logging function.
Or just declare some inline by-value getters in struct SERHeader_t
and use those; e.g.:
int32_t GetFrameCount() { return FrameCount; }
int32_t GetFrameCount() const { return FrameCount; }
(And actually you’d only need the const-qualified getter. I put a const and non-const getter because I forgot what I was doing for a bit.)
While working on upgrading nix to Mint 21.1 (based on Ubuntu Jammy) I got the following compiler error for capture:
Some discussion of this:
Seems like gcc got stricter about some edge case for references to packed struct members. I don't fully understand the details, or exactly how to fix / work-around it.
@jgottula any suggestions?