search for: lh_mous

Displaying 4 results from an estimated 4 matches for "lh_mous".

Did you mean: lh_mouse
2018 Aug 10
4
GCC 5 and -Wstrict-aliasing in JSON.h
...lue pointer is required. Hence, altering ``` return *reinterpret_cast<T *>(Union.buffer); ``` to ``` auto p = static_cast<void *>(Union.buffer); return *static_cast<T *>(p); ``` will probably resolve this problem. > Thanks, > - Kim > -- Best regards, LH_Mouse
2018 Aug 12
4
GCC 5 and -Wstrict-aliasing in JSON.h
...ink 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 this could happen. While writing this I realized that LH_Mouse's double static_cast also silences the warning, and I think that's a nicer workaround, so I put up a patch for that too, here: https://reviews.llvm.org/D50608 Let me know what you think, - Kim On Fri, Aug 10, 2018 at 11:30 PM Kim Gräsman <kim.grasman at gmail.com> wrote: > > O...
2018 Aug 09
2
GCC 5 and -Wstrict-aliasing in JSON.h
On Thu, 9 Aug 2018 at 22:59, Kim Gräsman <kim.grasman at gmail.com> wrote: > > Thanks all for pitching in to help! > > On Thu, Aug 9, 2018 at 1:25 PM, Sam McCall <sam.mccall at gmail.com> wrote: > > > > Obviously if there really is something illegal here we should fix it in > > LLVM, but it looks like this warning is a false positive (anyone disagree?)
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