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 failure with gcc-12 #190

Open
emollier opened this issue Jun 17, 2022 · 2 comments
Open

build failure with gcc-12 #190

emollier opened this issue Jun 17, 2022 · 2 comments

Comments

@emollier
Copy link
Contributor

Greetings,

with the recent introduction of Gcc 12 in Debian experimental, Matthias Klose noticed in Debian Bug#1012953 that Jellyfish fails to build from source using g++-12. Relevant part of the build log looks to be:

g++ -DHAVE_CONFIG_H -I.  -Wall -Wnon-virtual-dtor -I. -I./include  -DJSON_IS_AMALGAMATION=1 -Wdate-time -D_FORTIFY_SOURCE=2   -Werror -I./unit_tests/gtest/include -I./unit_tests -I./include -Wno-unused-variable -std=c++11 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wno-nonnull -c -o unit_tests/bin_test_all-test_misc.o `test -f 'unit_tests/test_misc.cc' || echo './'`unit_tests/test_misc.cc
In file included from unit_tests/test_misc.cc:6:
unit_tests/test_misc.cc: In member function ‘virtual void {anonymous}::BinarySearchFirst_Int_Test::TestBody()’:
unit_tests/test_misc.cc:73:68: error: ‘std::binder2nd<_Operation> std::bind2nd(const _Operation&, const _Tp&) [with _Operation = less<int>; _Tp = int]’ is deprecated: use 'std::bind' instead [-Werror=deprecated-declarations]
   73 |                                                        std::bind2nd(std::less<int>(), i)));
      |                                                        ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
./unit_tests/gtest/gtest.h:19418:52: note: in definition of macro ‘GTEST_ASSERT_’
19418 |   if (const ::testing::AssertionResult gtest_ar = (expression)) \
      |                                                    ^~~~~~~~~~
./unit_tests/gtest/gtest.h:19503:3: note: in expansion of macro ‘GTEST_PRED_FORMAT2_’
19503 |   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
      |   ^~~~~~~~~~~~~~~~~~~
./unit_tests/gtest/gtest.h:19748:3: note: in expansion of macro ‘EXPECT_PRED_FORMAT2’
19748 |   EXPECT_PRED_FORMAT2(::testing::internal:: \
      |   ^~~~~~~~~~~~~~~~~~~
unit_tests/test_misc.cc:72:5: note: in expansion of macro ‘EXPECT_EQ’
   72 |     EXPECT_EQ(i, *jellyfish::binary_search_first_false(jellyfish::pointer_integer<int>(0), jellyfish::pointer_integer<int>(size),
      |     ^~~~~~~~~
In file included from /usr/include/c++/12/bits/stl_function.h:1438,
                 from /usr/include/c++/12/functional:49,
                 from unit_tests/test_misc.cc:4:
/usr/include/c++/12/backward/binders.h:172:5: note: declared here
  172 |     bind2nd(const _Operation& __fn, const _Tp& __x)
      |     ^~~~~~~

If I trust the porting guide of Gcc 12, this might be a case of:

The std::unary_function and std::binary_function base classes can often be completely removed, or the typedefs for result_type and argument types can be defined directly in your class.

But I don't know how to translate that into a fix for the moment.

For information,
Étienne.

@gmarcais
Copy link
Owner

That should be fixed in the develop branch. Can you give it a try?

@emollier
Copy link
Contributor Author

Hi gmarcais,

Thank you for your work on this, I tested the develop branch in debian built with gcc-12, and I confirm the software: builds successfully, passes unit tests, and passes our own test suite "autopkgtest".

Have a nice day, :)
Étienne.

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

No branches or pull requests

2 participants