search for: d50607

Displaying 2 results from an estimated 2 matches for "d50607".

Did you mean: 50607
2018 Aug 12
4
GCC 5 and -Wstrict-aliasing in JSON.h
I did some more extensive testing and found that all GCCs older than 7 trigger the warning, but only if CMAKE_BUILD_TYPE=Release (which I guess indicates optimizations are enabled). There's a patch up for disabling the warning here: https://reviews.llvm.org/D50607. I still feel a little uncomfortable, because I think Jonathan makes an excellent point -- if GCC thinks there's a strict-aliasing violation (whether the standard agrees or not) and classifies this as undefined behavior, we might invoke the optimizers wrath. The warning is a nice hint that thi...
2018 Aug 10
2
GCC 5 and -Wstrict-aliasing in JSON.h
json::Value in JSON.h is a discriminated union. The storage is a char array of appropriate type and alignment. The storage holds one object at a time, it's initialized (and for nontrivial types, destroyed) at the right times to ensure this. The cast is only to the type of object that's already there, there's no magic here. On Fri, Aug 10, 2018, 17:52 Andrew Haley <aph at