genodelabs / goa

Tool for streamlining the development of Genode applications
GNU Affero General Public License v3.0
19 stars 18 forks source link

Build error when using `Gui::Session::Command` #59

Closed jschlatow closed 10 months ago

jschlatow commented 1 year ago

When trying to build the lvgl_support library without strict warnings disabled, I'm getting the following build error:

/home/johannes/repos/genode/depot/genodelabs/api/gui_session/2023-03-12/include/gui_session/gui_session.h: In instantiation of ‘Gui::Session::Command::Command(ARGS) [with ARGS = Gui::Session::Command::To_front]’:
/home/johannes/repos/genode/depot/genodelabs/api/gui_session/2023-03-12/include/gui_session/client.h:103:12:   required from ‘void Gui::Session_client::enqueue(ARGS ...) [with CMD = Gui::Session::Command::To_front; ARGS = {Genode::Handle<Gui::View>, Genode::Handle<Gui::View>}]’
/home/johannes/repos/goa-pkgs/lvgl/lvgl_support/src/lvgl_support.cc:172:69:   required from here
/home/johannes/repos/genode/depot/genodelabs/api/gui_session/2023-03-12/include/gui_session/gui_session.h:139:29: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  139 |    reinterpret_cast<ARGS &>(nop) = args;
      |                             ^~~
/home/johannes/repos/genode/depot/genodelabs/api/gui_session/2023-03-12/include/gui_session/gui_session.h:139:34: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  139 |    reinterpret_cast<ARGS &>(nop) = args;
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
cc1plus: all warnings being treated as errors

Apparently, this is due to a missing -fno-strict-aliasing which is present in the Genode build system but not in Goa.

jschlatow commented 1 year ago

Commit 45f2aa3 adds this to the cxxflags as a quirk whenever the gui_session api is used.