Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Jan 23, 2023

With GCC 12 and Boost 1.81 (from depends) having multiple warnings:

In file included from /home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/config.hpp:48:
/home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/config/stdlib/libstdcpp3.hpp:397:9: warning: 'BOOST_NO_CXX98_FUNCTION_BASE' macro redefined [-Wmacro-redefined]
#define BOOST_NO_CXX98_FUNCTION_BASE
        ^
<command line>:8:9: note: previous definition is here
#define BOOST_NO_CXX98_FUNCTION_BASE 1
        ^
1 warning generated.

This PR fixes those warnings.

Defining of the BOOST_NO_CXX98_FUNCTION_BASE macro was introduced in #25436, but since boostorg/config#430, it is required to check it before adding.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 23, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK fanquake

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@hebasto
Copy link
Member Author

hebasto commented Jan 24, 2023

Updated 387a99d -> bb76ac4 (pr26952.01 -> pr26952.02, diff):

@fanquake
Copy link
Member

I don't think this works? BOOST_NO_CXX98_FUNCTION_BASE is still set when using Boost 1.81.0 and GCC 12. So you still get the warnings. i.e with this branch (rebased on master):

# gcc-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0
make -C depends/ CC=gcc-12 CXX=g++-12
./autogen.sh
CONFIG_SITE=/home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/share/config.site ./configure
checking whether BOOST_NO_CXX98_FUNCTION_BASE macro definition is needed... yes
make -j9
...
In file included from /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/config.hpp:48,
                 from /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/multi_index/hashed_index.hpp:16,
                 from ./txmempool.h:35,
                 from blockencodings.cpp:13:
/home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/config/stdlib/libstdcpp3.hpp:397: warning: "BOOST_NO_CXX98_FUNCTION_BASE" redefined
  397 | #define BOOST_NO_CXX98_FUNCTION_BASE
      | 

@hebasto
Copy link
Member Author

hebasto commented Jan 28, 2023

I don't think this works?

Thanks! Should be fixed now.

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

ACK d4c59da - it works now.

@fanquake fanquake merged commit 2b211b4 into bitcoin:master Jan 31, 2023
@hebasto hebasto deleted the 230123-boost branch January 31, 2023 15:06
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 31, 2023
…o redefinition

d4c59da build: Avoid `BOOST_NO_CXX98_FUNCTION_BASE` macro redefinition (Hennadii Stepanov)

Pull request description:

  With GCC 12 and Boost 1.81 (from depends) having multiple warnings:
  ```
  In file included from /home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/config.hpp:48:
  /home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/config/stdlib/libstdcpp3.hpp:397:9: warning: 'BOOST_NO_CXX98_FUNCTION_BASE' macro redefined [-Wmacro-redefined]
  #define BOOST_NO_CXX98_FUNCTION_BASE
          ^
  <command line>:8:9: note: previous definition is here
  #define BOOST_NO_CXX98_FUNCTION_BASE 1
          ^
  1 warning generated.
  ```

  This PR fixes those warnings.

  Defining of the `BOOST_NO_CXX98_FUNCTION_BASE` macro was introduced in bitcoin#25436, but since boostorg/config#430, it is required to check it before adding.

ACKs for top commit:
  fanquake:
    ACK d4c59da - it works now.

Tree-SHA512: 53b9ddcf8dad729638ed41251e30c80f2d7d1ae3ffe47466865834f1f10184fe0881abeb339b3e46c270c3eb11fb63d19ab12cc9461bf5c2be12b4763c1b1c34
@bitcoin bitcoin locked and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants