Xeverous

Results 189 comments of Xeverous

Adding more, which should bring you more light on the issue: Code that relies on aliasing violations has been written for many years in many widely used projects. The aliasing...

> but they are pointers obtained from a basic_window reinterpreted as window. No aliases problem here. There are problems. `window` (actually `detail::native_window_impl`) and `basic_window` are not **similar** types as per...

> here the OBJECT is unique, not the type - unique adress Object being unique is irrelevant. The problem is that there are 2 unique types that both refer to...

> The original VALUE of the pointer, the only object created is a basic_window . The pointer to this object is reinterpreted to window and then back to basic_window with...

> I dont see why you assume this is an intention to do tag dispatching You don't need to. It was only my guess how the API was supposed to...

Compiling with my project, by `add_subdirectory`. Crashes also if I remove my project dependency and just compile a short main function that only uses nana library.

> But `detail::window_handle_impl` is an incomplete type. It is complete. These are not forward declarations: https://github.com/cnjinhao/nana/blob/ffa170b5f560dbf899030bdeb0e539aa95b03649/include/nana/gui/basis.hpp#L25-L31 Note that the completeness has no meaning for strict aliasing. > `alignof(basic_window*)

Can do some PRs. You have removed some casts already, would just need to verify others. Should not be hard to fix.

The crash is here: https://github.com/cnjinhao/nana/blob/38cdf4779456ba697d7da863f7c623e25d30f650/source/detail/platform_spec_posix.cpp#L469-L470 ``` #0 nana::detail::platform_spec::platform_spec (this=0x5555558f7320 ) at /home/xeverous/workspace/xeverous_nana/source/detail/platform_spec_posix.cpp:470 #1 0x0000555555592dc5 in nana::detail::platform_spec::instance () at /home/xeverous/workspace/xeverous_nana/source/detail/platform_spec_posix.cpp:575 #2 0x00005555555a0ce5 in nana::detail::bedrock::bedrock (this=0x5555558f7660 ) at /home/xeverous/workspace/xeverous_nana/source/gui/detail/bedrock_posix.cpp:135 #3 0x00005555555a0d4a in...

Something like this? display_ = ::XOpenDisplay(0); if (display_ == nullptr) throw /* ... */ Many things are not checked, it would be good to have some assert / print /...