Page MenuHomePhabricator

Fix the build with GCC < 8
ClosedPublic

Authored by Fabien on Feb 4 2020, 09:50.

Details

Summary

Fix the `sorry, unimplemented: non-trivial designated initializers not
supported` failure with GCC version < 8.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55606 and
https://stackoverflow.com/questions/31215971/non-trivial-designated-initializers-not-supported.

Test Plan

Build with GCC 7 and check the error is gone.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix_gcc_build
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9256
Build 16454: Default Diff Build & Tests
Build 16453: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.Feb 4 2020, 15:01
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/chainparams.cpp
484

This is used here, so clearly reverting it is not the right path forward, at least not without going through the trouble of figuring out why it works in one case and not the other.

This revision now requires changes to proceed.Feb 4 2020, 15:01
Fabien requested review of this revision.Feb 4 2020, 15:08
Fabien added inline comments.
src/chainparams.cpp
484

This is a GCC limitation. It works only if the named initializers are in order with no missing one in the middle: https://stackoverflow.com/a/46067271

deadalnix requested changes to this revision.Feb 4 2020, 15:19
deadalnix added inline comments.
src/chainparams.cpp
484

Then it sounds like we might want to do that. Or wonder if we actually support gcc 8, and if we do than why the hell did D5139 pass CI?

This revision now requires changes to proceed.Feb 4 2020, 15:19

Insert missing initializer rather than doing it core way.

src/chainparams.cpp
484

The CI runs gcc-8. I'm working toward adding other machines with various new builds.

This revision is now accepted and ready to land.Feb 4 2020, 16:13
This revision was automatically updated to reflect the committed changes.