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

build: Fix compilation with GCC 13 #2653

Merged

Conversation

theMarix
Copy link
Contributor

On GCC 13 stdexcept seems to be implicitly included in less places. The same goes for cstdint.

@div72
Copy link
Member

div72 commented Mar 11, 2023

Should probably add the includes to all files explicitly, some source files seem to get the includes from others:

div72@div72s-MacBook-Air ~/dev/Gridcoin-Research (2653) $ cat <(git grep -L -E "cstdint" $(git grep -l -E "int[0-9]{1,2}_t" -- "src/" ":(exclude)src/crc32c" ":(exclude)src/leveldb" ":(exclude)src/secp256k1")) <(git grep -L -E "stdexcept" $(git grep -l -E "((logic|domain|length|runtime|range|overflow|underflow)_error)|invalid_argument|out_of_range" -- src/ ":(exclude)src/crc32c" ":(exclude)src/leveldb" ":(exclude)src/secp256k1")) | uniq | sort
src/addrdb.h
src/addrman.cpp
src/addrman.h
src/alert.h
src/amount.h
src/arith_uint256.cpp
src/arith_uint256.h
src/banman.cpp
src/base58.cpp
src/bignum.h
src/chainparams.cpp
src/chainparams.h
src/compat/byteswap.h
src/compat/cpuid.h
src/compat/endian.h
src/consensus/merkle.cpp
src/consensus/merkle.h
src/consensus/params.h
src/consensus/tx_verify.cpp
src/consensus/tx_verify.h
src/crypto/chacha20.cpp
src/crypto/chacha20.h
src/crypto/common.h
src/crypto/ctaes/ctaes.c
src/crypto/ctaes/ctaes.h
src/crypto/poly1305.cpp
src/crypto/ripemd160.cpp
src/crypto/ripemd160.h
src/crypto/sha1.cpp
src/crypto/sha1.h
src/crypto/sha256.cpp
src/crypto/sha256.h
src/crypto/sha256_avx2.cpp
src/crypto/sha256_shani.cpp
src/crypto/sha256_sse4.cpp
src/crypto/sha256_sse41.cpp
src/crypto/sha3.cpp
src/crypto/sha3.h
src/crypto/sha512.cpp
src/crypto/sha512.h
src/crypto/siphash.cpp
src/crypto/siphash.h
src/dbwrapper.cpp
src/dbwrapper.h
src/gridcoin/account.h
src/gridcoin/accrual/computer.h
src/gridcoin/accrual/newbie.h
src/gridcoin/accrual/null.h
src/gridcoin/accrual/research_age.h
src/gridcoin/accrual/snapshot.h
src/gridcoin/appcache.cpp
src/gridcoin/appcache.h
src/gridcoin/backup.cpp
src/gridcoin/backup.h
src/gridcoin/beacon.cpp
src/gridcoin/beacon.h
src/gridcoin/block_index.h
src/gridcoin/claim.cpp
src/gridcoin/claim.h
src/gridcoin/contract/contract.cpp
src/gridcoin/contract/contract.h
src/gridcoin/cpid.h
src/gridcoin/gridcoin.cpp
src/gridcoin/magnitude.h
src/gridcoin/mrc.cpp
src/gridcoin/mrc.h
src/gridcoin/project.cpp
src/gridcoin/project.h
src/gridcoin/quorum.cpp
src/gridcoin/quorum.h
src/gridcoin/researcher.cpp
src/gridcoin/scraper/fwd.h
src/gridcoin/scraper/http.cpp
src/gridcoin/scraper/http.h
src/gridcoin/scraper/scraper.cpp
src/gridcoin/scraper/scraper.h
src/gridcoin/scraper/scraper_net.cpp
src/gridcoin/scraper/scraper_net.h
src/gridcoin/staking/chain_trust.h
src/gridcoin/staking/difficulty.cpp
src/gridcoin/staking/difficulty.h
src/gridcoin/staking/kernel.cpp
src/gridcoin/staking/kernel.h
src/gridcoin/staking/reward.cpp
src/gridcoin/staking/reward.h
src/gridcoin/staking/spam.h
src/gridcoin/staking/status.cpp
src/gridcoin/staking/status.h
src/gridcoin/superblock.cpp
src/gridcoin/superblock.cpp
src/gridcoin/superblock.h
src/gridcoin/support/block_finder.cpp
src/gridcoin/support/enumbytes.h
src/gridcoin/tally.cpp
src/gridcoin/tally.h
src/gridcoin/tx_message.h
src/gridcoin/upgrade.cpp
src/gridcoin/voting/builders.cpp
src/gridcoin/voting/builders.h
src/gridcoin/voting/claims.h
src/gridcoin/voting/payloads.h
src/gridcoin/voting/poll.cpp
src/gridcoin/voting/poll.h
src/gridcoin/voting/registry.cpp
src/gridcoin/voting/registry.h
src/gridcoin/voting/result.cpp
src/gridcoin/voting/result.h
src/gridcoin/voting/vote.cpp
src/gridcoin/voting/vote.h
src/hash.cpp
src/hash.h
src/init.cpp
src/key.cpp
src/key.h
src/logging.cpp
src/main.cpp
src/main.h
src/miner.cpp
src/miner.h
src/net.cpp
src/net.h
src/netbase.cpp
src/netbase.h
src/node/ui_interface.cpp
src/node/ui_interface.h
src/noui.cpp
src/pbkdf2.cpp
src/pbkdf2.h
src/policy/fees.h
src/prevector.h
src/protocol.cpp
src/protocol.h
src/pubkey.h
src/qt/bitcoin.cpp
src/qt/bitcoingui.cpp
src/qt/bitcoingui.h
src/qt/clientmodel.cpp
src/qt/clientmodel.h
src/qt/coincontroldialog.cpp
src/qt/consolidateunspentwizardselectinputspage.cpp
src/qt/diagnosticsdialog.cpp
src/qt/guiutil.cpp
src/qt/guiutil.h
src/qt/intro.cpp
src/qt/intro.h
src/qt/notificator.cpp
src/qt/optionsmodel.cpp
src/qt/optionsmodel.h
src/qt/researcher/researchermodel.cpp
src/qt/transactiondesc.cpp
src/qt/transactionrecord.cpp
src/qt/transactionrecord.h
src/qt/transactiontablemodel.cpp
src/qt/voting/pollcard.cpp
src/qt/voting/votewizardballotpage.cpp
src/qt/voting/votingmodel.cpp
src/qt/voting/votingmodel.h
src/qt/walletmodel.cpp
src/qt/walletmodel.h
src/random.cpp
src/randomenv.cpp
src/rpc/blockchain.cpp
src/rpc/dataacq.cpp
src/rpc/mining.cpp
src/rpc/net.cpp
src/rpc/protocol.cpp
src/rpc/rawtransaction.cpp
src/rpc/server.cpp
src/rpc/server.h
src/rpc/voting.cpp
src/script.cpp
src/script.h
src/scrypt.cpp
src/serialize.h
src/streams.h
src/streams.h
src/sync.cpp
src/sync.h
src/test/allocator_tests.cpp
src/test/crypto_tests.cpp
src/test/dos_tests.cpp
src/test/gridcoin/beacon_tests.cpp
src/test/gridcoin/claim_tests.cpp
src/test/gridcoin/contract_tests.cpp
src/test/gridcoin/enumbytes_tests.cpp
src/test/gridcoin/enumbytes_tests.cpp
src/test/gridcoin/magnitude_tests.cpp
src/test/gridcoin/project_tests.cpp
src/test/gridcoin/researcher_tests.cpp
src/test/gridcoin/superblock_tests.cpp
src/test/gridcoin_tests.cpp
src/test/merkle_tests.cpp
src/test/random_tests.cpp
src/test/serialize_tests.cpp
src/test/test_gridcoin.h
src/test/transaction_tests.cpp
src/test/wallet_tests.cpp
src/uint256.cpp
src/uint256.h
src/univalue/include/univalue.h
src/univalue/lib/univalue.cpp
src/univalue/lib/univalue_get.cpp
src/univalue/lib/univalue_read.cpp
src/univalue/test/object.cpp
src/util.cpp
src/util.cpp
src/util.h
src/util.h
src/util/settings.h
src/util/strencodings.cpp
src/util/system.cpp
src/util/system.h
src/util/time.cpp
src/util/time.cpp
src/util/time.h
src/util/tokenpipe.cpp
src/validation.cpp
src/validation.h
src/wallet/db.cpp
src/wallet/diagnose.cpp
src/wallet/diagnose.h
src/wallet/ismine.h
src/wallet/rpcdump.cpp
src/wallet/rpcwallet.cpp
src/wallet/wallet.cpp
src/wallet/wallet.h
src/wallet/walletdb.cpp
src/wallet/walletdb.h

@jamescowens
Copy link
Member

jamescowens commented Mar 11, 2023

Isn't this going to create conflicts with the other PR's?

@jamescowens jamescowens changed the title Fix complition with GCC 13 Fix compilation with GCC 13 Mar 11, 2023
@jamescowens jamescowens changed the title Fix compilation with GCC 13 build: Fix compilation with GCC 13 Mar 11, 2023
@theMarix
Copy link
Contributor Author

@jamescowens , was your comment direct at @div72 or at me?

@jamescowens
Copy link
Member

Both of you! :)

I just did a test rebase of my very large in progress PR #2639 and it isn't too bad actually.

git checkout replace_remaining_appcache
git branch replace_remaining_appcache_based_on_gcc13_compile_correction
git fetch origin pull/2653/head:gcc13_compile_correction
git checkout replace_remaining_appcache_based_on_gcc13_compile_correction
git rebase gcc13_compile_correction
Auto-merging configure.ac
CONFLICT (content): Merge conflict in configure.ac
error: could not apply 9f1bba8... Increment version to 5.4.0.4.
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 9f1bba8... Increment version to 5.4.0.4.

@theMarix if you rebase your branch on current development (which you should do any way because 5.4.0.4 is really old at this point, it is prior to the current release even), this conflict will likely go away entirely.

@jamescowens
Copy link
Member

Assuming @theMarix and @div72 can agree on the form of this PR, I will actually merge it for the LaVerne release coming up. I would like to do this very soon. Thanks. :)

@div72
Copy link
Member

div72 commented Mar 13, 2023

Alright, I'll add the headers to the rest then when we do not have much PR traffic.

@theMarix You need to rebase to the head of current development branch, src/util/bip32.h does not compile with GCC-13 currently due to needing cstdint include.

@theMarix
Copy link
Contributor Author

@jamescowens , I was rather certain I had branched this of 5.4.1.0 as I patched the RPM build but I'll rebase nevertheless.

On GCC 13 stdexcept seems to be implicitly included in less places.
The same goes for cstdint.
@theMarix
Copy link
Contributor Author

@div72 , rebase is done.

@jamescowens
Copy link
Member

@div72 let's get this in now. It doesn't conflict too bad with #2639. I don't know about yours...
@theMarix we prefer for PR's to be based against the head of the development branch, not master, when they are submitted, unless it is for a hotfix.

Copy link
Member

@div72 div72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK cecebc8.

Compiles fine with GCC 13.0.1 on Fedora 38 docker image. I don't really care about it conflicting with my PR as it's just header changes.

@jamescowens jamescowens merged commit 1ee63fe into gridcoin-community:development Mar 14, 2023
@theMarix theMarix deleted the fix-gcc13-build branch March 18, 2023 08:17
jamescowens added a commit to jamescowens/Gridcoin-Research that referenced this pull request Mar 26, 2023
Added
 - key, wallet: HD wallets gridcoin-community#2540 (@div72)
 - ARMv8 SHA2 Intrinsics gridcoin-community#2612 (@barton2526)
 - build: vendor bdb 5.3 gridcoin-community#2620 (@div72)
 - scraper, gui: Add external adapter projects indication gridcoin-community#2625 (@jamescowens)
 - gui: implement INSUFFICIENT_MATURE_FUNDS status for the mrcmodel gridcoin-community#2628 (@jamescowens)
 - gui, accrual: Implement accrual limit warning gridcoin-community#2636 (@jamescowens)
 - rpc: add `getnodeaddresses` gridcoin-community#2646 (@Pythonix)
 - consensus: Add new checkpoints gridcoin-community#2651 (@barton2526)

Changed
 - voting: Optimize poll locks gridcoin-community#2619 (@jamescowens)
 - util: move threadinterrupt.{cpp,h} to util gridcoin-community#2613 (@Pythonix)
 - gui, voting: Update pool cpids and avw rules gridcoin-community#2624 (@jamescowens)
 - ci: bump python and setup-python action version gridcoin-community#2626 (@div72)
 - gui: Change text from username to name (real name or nickname) gridcoin-community#2633 (@jamescowens)
 - locale: Translation update, phase 1 gridcoin-community#2637 (@jamescowens)
 - gui: Change MRC too soon to submit error to be less confusing gridcoin-community#2645 (@jamescowens)
 - locale: Update translations prior to release (phase 2/2) gridcoin-community#2658 (@jamescowens)
 - gui: Enhance MRC request form to avoid fee boost field confusion gridcoin-community#2659 (@jamescowens)

Removed
none

Fixed
 - net: Turn net structures into dumb storage classes (backport) gridcoin-community#2561 (@Pythonix)
 - build: Include native_X.mk before X.mk gridcoin-community#2609 (@barton2526)
 - depends: fix OpenSSL for Darwin builds gridcoin-community#2610 (@div72)
 - build: Change actions runner image to Focal, Force Lint to use 22.04, Change cd runner version gridcoin-community#2611 (@barton2526)
 - gui: don't show datadir error msgbox if arg isn't specified gridcoin-community#2617 (@div72)
 - rpc: Repair auditsnapshotaccrual rpc function gridcoin-community#2621 (@jamescowens)
 - gui: Correct updateBeaconIcon() function in bitcoingui.cpp gridcoin-community#2622 (@jamescowens)
 - wallet: Strengthen CWalletTx::RevalidateTransactions gridcoin-community#2627 (@jamescowens)
 - test: Fix Wambiguous-reversed-operator compiler warning, drop boost::assign gridcoin-community#2632 (@barton2526)
 - gui: Fix wallet overview displaying lower-case poll name gridcoin-community#2640 (@delta1513)
 - Fix and optimize ResendWalletTransactions gridcoin-community#2642 (@jamescowens)
 - build(nsis): Write registry keys to HKLM instead of HKCU, Install shortcuts for all users, Fix INSTALLDIR removal bug gridcoin-community#2643 (@sitiom)
 - gui: Fix TransactionRecord::decomposeTransaction to properly display self-sidestake gridcoin-community#2647 (@jamescowens)
 - rpc: Fixed the RPC error when running `help voting` while syncing gridcoin-community#2649 (@delta1513)
 - build: Fix compilation with GCC 13 gridcoin-community#2653 (@theMarix)
 - rpc: Formatting - typo correction rpc help for listresearcheraccounts gridcoin-community#2654 (@PrestackI)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants