Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] error: static assertion failed: static_assert(sizeof(Instruction) == 8); the comparison reduces to '(16 == 8)' #4937

Closed
barracuda156 opened this issue Jun 26, 2023 · 3 comments · Fixed by #4939
Labels

Comments

@barracuda156
Copy link
Contributor

Version of Kakoune

v2022.10.31

Reproducer

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_kakoune/kakoune/work/compwrap/cxx/opt/local/bin/g++-mp-12 -isystem/opt/local/include/LegacySupport -I/opt/local/include -I/opt/local/include -Os -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -pedantic -std=c++2a -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-init-list-lifetime -MD -MP -MF .command_manager.opt.d -c -o .command_manager.opt.o command_manager.cc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_kakoune/kakoune/work/compwrap/cxx/opt/local/bin/g++-mp-12 -isystem/opt/local/include/LegacySupport -I/opt/local/include -I/opt/local/include -Os -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -pedantic -std=c++2a -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-init-list-lifetime -MD -MP -MF .commands.opt.d -c -o .commands.opt.o commands.cc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_kakoune/kakoune/work/compwrap/cxx/opt/local/bin/g++-mp-12 -isystem/opt/local/include/LegacySupport -I/opt/local/include -I/opt/local/include -Os -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -pedantic -std=c++2a -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-init-list-lifetime -MD -MP -MF .completion.opt.d -c -o .completion.opt.o completion.cc
In file included from regex.hh:5,
                 from command_manager.cc:12:
regex_impl.hh:120:39: error: static assertion failed
  120 |     static_assert(sizeof(Instruction) == 8);
      |                   ~~~~~~~~~~~~~~~~~~~~^~~~
regex_impl.hh:120:39: note: the comparison reduces to '(16 == 8)'
In file included from regex.hh:5,
                 from commands.cc:25:
regex_impl.hh:120:39: error: static assertion failed
  120 |     static_assert(sizeof(Instruction) == 8);
      |                   ~~~~~~~~~~~~~~~~~~~~^~~~
regex_impl.hh:120:39: note: the comparison reduces to '(16 == 8)'
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_kakoune/kakoune/work/compwrap/cxx/opt/local/bin/g++-mp-12 -isystem/opt/local/include/LegacySupport -I/opt/local/include -I/opt/local/include -Os -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -pedantic -std=c++2a -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-init-list-lifetime -MD -MP -MF .context.opt.d -c -o .context.opt.o context.cc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_kakoune/kakoune/work/compwrap/cxx/opt/local/bin/g++-mp-12 -isystem/opt/local/include/LegacySupport -I/opt/local/include -I/opt/local/include -Os -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -pedantic -std=c++2a -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-init-list-lifetime -MD -MP -MF .display_buffer.opt.d -c -o .display_buffer.opt.o display_buffer.cc
make[1]: *** [.command_manager.opt.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from regex.hh:5,
                 from completion.cc:5:
regex_impl.hh:120:39: error: static assertion failed
  120 |     static_assert(sizeof(Instruction) == 8);
      |                   ~~~~~~~~~~~~~~~~~~~~^~~~
regex_impl.hh:120:39: note: the comparison reduces to '(16 == 8)'
make[1]: *** [.completion.opt.o] Error 1
make[1]: *** [.commands.opt.o] Error 1

Outcome

It fails to build :)

Expectations

Obviously, it should not.

Additional information

Apparently, the codebase ignores bitness.

@barracuda156
Copy link
Contributor Author

Or otherwise size of bool is assumed to be 1 byte, while it is 4 byte on Darwin ppc.

@barracuda156
Copy link
Contributor Author

Then it also fails on the following:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_kakoune/kakoune/work/compwrap/cxx/opt/local/bin/g++-mp-12 -isystem/opt/local/include/LegacySupport -I/opt/local/include -I/opt/local/include -Os -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -pedantic -std=c++2a -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-init-list-lifetime -MD -MP -MF .remote.opt.d -c -o .remote.opt.o remote.cc
regex_impl.cc:83:20: warning: ignoring packed attribute because of unpacked non-POD field 'Kakoune::ParsedRegex::Quantifier Kakoune::ParsedRegex::Node::quantifier'
   83 |         Quantifier quantifier;
      |                    ^~~~~~~~~~
regex_impl.cc:86:32: error: static assertion failed
   86 |     static_assert(sizeof(Node) == 16, "");
      |                   ~~~~~~~~~~~~~^~~~~
regex_impl.cc:86:32: note: the comparison reduces to '(28 == 16)'
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_kakoune/kakoune/work/compwrap/cxx/opt/local/bin/g++-mp-12 -isystem/opt/local/include/LegacySupport -I/opt/local/include -I/opt/local/include -Os -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -O3 -pedantic -std=c++2a -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-init-list-lifetime -MD -MP -MF .scope.opt.d -c -o .scope.opt.o scope.cc
make[1]: *** [.regex_impl.opt.o] Error 1

@barracuda156
Copy link
Contributor Author

barracuda156 commented Jun 26, 2023

Perhaps not a phenomenal fix, but commenting out two static asserts let it build and launch:
kakoune

UPD. This is the first time I launched the app, but it seems to work fine: responds to commands etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant