Page MenuHomePhabricator

Fix the build with GCC < 8
ClosedPublic

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

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABCecfd419e5236: Fix the build with GCC < 8
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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Tue, Feb 4, 09:50
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Feb 4, 09:50
deadalnix requested changes to this revision.Tue, Feb 4, 15:01
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/chainparams.cpp
484 ↗(On Diff #15991)

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.Tue, Feb 4, 15:01
Fabien requested review of this revision.Tue, Feb 4, 15:08
Fabien added inline comments.
src/chainparams.cpp
484 ↗(On Diff #15991)

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.Tue, Feb 4, 15:19
deadalnix added inline comments.
src/chainparams.cpp
484 ↗(On Diff #15991)

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.Tue, Feb 4, 15:19
Fabien updated this revision to Diff 16005.Tue, Feb 4, 16:08

Insert missing initializer rather than doing it core way.

Fabien added inline comments.Tue, Feb 4, 16:09
src/chainparams.cpp
484 ↗(On Diff #15991)

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

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